NeverHappyMike
Member
Hi
I've inherited a workbook that has lots and lots of yearly datasheets (and we keep adding to them). I'm in the process of amending a macro to recalculate the data in each sheet, but I wondered if there is a more suitable way to write an array for assigning the worksheets to a year, rather having to hard code it each time?
Many thanks for your help.
Michael.
Currently the macro includes:
[pre]
[/pre]
I've inherited a workbook that has lots and lots of yearly datasheets (and we keep adding to them). I'm in the process of amending a macro to recalculate the data in each sheet, but I wondered if there is a more suitable way to write an array for assigning the worksheets to a year, rather having to hard code it each time?
Many thanks for your help.
Michael.
Currently the macro includes:
[pre]
Code:
Dim year as variable, y as variable
Year = Array (1951"", "1952", "1953",........"2008"....)
----THE YEARS ARE HARD CODED AND ADDED TO EACH TIME A NEW YEARLY WORKSHEET IS ADDED
For Each y In year
Sheets(y).Activate
etc, etc.