Good afternoon,
The first code got the value 2012. And I want to use this value 2012 to refer an existing sheet named 2012 to get its last row.
But it did not work.
Appreciate your help.
DL
The first code got the value 2012. And I want to use this value 2012 to refer an existing sheet named 2012 to get its last row.
But it did not work.
Appreciate your help.
DL
Code:
CurrentYear = Year(Worksheets("Data").Cells(5, 1))
CYSheet = Worksheets(CurrentYear).Name
CYLastRow = Worksheets(CYSheet).Cells(Rows.Count, 1).End(xlUp).Row