Hi, I am trying to tweak this code so that instead of manually typing in the code the new month in MM format every new month I can just reference the value in cell K1 that updates on its own.
Is there a way that I can replace the month replacement value "/01/" with the data that is in cell K1? In cell K1 I have this formula "=TEXT(TODAY(),"MM")"
Thanks in advance for any help.
Is there a way that I can replace the month replacement value "/01/" with the data that is in cell K1? In cell K1 I have this formula "=TEXT(TODAY(),"MM")"
Thanks in advance for any help.
Code:
Sub current_YYMM()
Columns("I:I").Select
'YEAR
Selection.Replace What:="/YYYY/", Replacement:="/2019/", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=True, SearchFormat:=False, _
ReplaceFormat:=False
' MONTH
Selection.Replace What:="/MM/", Replacement:="/01/", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=True, SearchFormat:=False, _
ReplaceFormat:=False
Range("J1").Select
ActiveCell.FormulaR1C1 = "Current Date"
End Sub