Good day everyone,
Up until now my script has always worked when formatting a date for the current month, and Month 1, but since it's end of year, I need it reference January from December but it gives me an error when I select this because I believe it thinks it's going to the 13th month, which we know there isn't one.
Here is how my code is for when I use it anytime else:
d = Date
d = DateSerial(Year(d), Month(d), Day(d) )
MthNameCurrent = MonthName(Month(D)) & " 2019 DLY SLS & GROSS MARGIN"
MthNameNew = MonthName(Month(D) 1) & " 2019 DLY SLS & GROSS MARGIN"
But now I need it to go from December(12) to January(1).
Quick fix is I did this:
MthNameCurrent = MonthName(Month(D)) & " 2019 DLY SLS & GROSS MARGIN"
MthNameNew = MonthName(Month(D)-11) & " 2020 DLY SLS & GROSS MARGIN"
Although I don't want to have to modify this date again in the fututre, is there any way to have it know what I mean when it's 12 and I need to go 1 to 01 instead of 13?
Sorry if that's confusing.
Thank you in advance.
#Rumba