I have a quarterly report template with columns for each month followed by a quarterly total with a year end total as the last column. The monthly headers include "Month-Year" "mmm-yy" the quarterly column headers contain the quarter and year "1st Quarter 2022" and the year end column header is "YYYY Total". I am trying to create vba syntax that will update all column headers to the current year when opened for the 1st quarter compilation. I am able to update the individual month's year and the year end column's year, but not the quarterlies. A sample of the column headers are below and I am currently working with this syntax:
If WSM1.Cells(1, VVV) = ("1st Quarter" & YrL) Then
WSM1.Cells(1, VVV) = ("1st Quarter" & Yr)
This should evaluate the 1st quarter header as "1st Quarter & YrL", when I hover over the "WSM1.Cells(1, VVV)" it shows "1st Quarter 2022" bit it is not recognizing it as ("1st Quarter" & YrL), thus it is not updating to the current year.
If WSM1.Cells(1, VVV) = ("1st Quarter" & YrL) Then
WSM1.Cells(1, VVV) = ("1st Quarter" & Yr)
This should evaluate the 1st quarter header as "1st Quarter & YrL", when I hover over the "WSM1.Cells(1, VVV)" it shows "1st Quarter 2022" bit it is not recognizing it as ("1st Quarter" & YrL), thus it is not updating to the current year.
| Feb-22 | Mar-22 | 1st Quarter 2022 |