I have a part of a macro that changes the year date range for me, with this macro I would like to automatically change the range every month when I run the macro. For example, in December he wants December 2020-12: 2021-12.
But when I do that with code it gets something like this and formula looks like : =INDEX($A$1:$AE$13,2,match(#ADR!,1:1,0))
How can resolve this ?
VBA Code:
With wbMe.Worksheets("input_6")
.Range("X26").Delete xlShiftToLeft
.Range("AJ26").Value = DateAdd("m", 1, .Range("AI26").Value)
End With
=INDEX($A$1:$AE$13,2,match(X26,1:1,0))
How can resolve this ?