Date: prev next · Thread: first prev next last
2018 Archives by date, by thread · List index

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)
        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)

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.

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:

To unsubscribe e-mail to:
Posting guidelines + more:
List archive:
All messages sent to this list will be publicly archived and cannot be deleted


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.