2018-01-28 15:45 GMT+01:00 Luuk <[email protected]>: > You can write a FUNCTION to get next month > > Function FirstOfNextMonth(dDate as Date) as Date > if Month(dDate)>=12 then > FirstOfNextMonth = DateSerial(Year(dDate)+1, 1, 1) > else > FirstOfNextMonth = DateSerial(Year(dDate), Month(dDate)+1, 1) > end if > End Function > > > When you use = FirstOfNextMonth(Now()) is will return 01-02-2018 (if > your date-format = DD-MM-YYYY) >
Just note that your function always returns the first day of the calculated month. I'm not sure the OP wants that, but maybe I'm wrong. Kind regards Johnny Rosenberg > > > On 27-01-18 22:26, bjlockie wrote: > > I keep a spreadsheet with a monthly budget. > > Each month I copy a month to make a new month. > > I use Fill to change the dates to the new month. > > This is not ideal because sometimes there are 2 rows for the same day and > > Fill changes the 2nd day. > > I need a macro just to change the month and not the day. > > > > Eg. > > Jan 1 2018 | debit | ... > > Jan 1 2018 | credit card | ... > > Jan 2 2018 | credit card | ... > > > > Using Fill to get a new section for Feb results in: > > Feb 1 2018 | debit | ... > > Feb 2 2018 | credit card | ... > > Feb 3 2018 | credit card | ... > > > > What I want is: > > Feb 1 2018 | debit | ... > > Feb 1 2018 | credit card | ... > > Feb 2 2018 | credit card | ... > > > > > > > > > > -- > > Sent from: http://nabble.documentfoundation.org/Users-f1639498.html > > > > > -- > To unsubscribe e-mail to: [email protected] > Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to- > unsubscribe/ > Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette > List archive: https://listarchives.libreoffice.org/global/users/ > All messages sent to this list will be publicly archived and cannot be > deleted > -- To unsubscribe e-mail to: [email protected] Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette List archive: https://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
