hey guys, I am at my wits end trying to play with arrays and whatnot... what I want to do in simple terms is create a loop that runs code through sheets that are listed in a worksheet. For example....
Workbook.xls has the following worksheets:
Worksheet1
Worksheet2
Worksheet3
Worksheet4
Worksheet5
Worksheet6
Worksheet7
Worksheet8
Worksheet9
Worksheet10
Worksheet 10 has these values in Range A1:A6
A1: "Worksheet2"
A2: "Worksheet4"
A3: "Worksheet5"
A4: "Worksheet6"
A5: "Worksheet7"
A6: "Worksheet9"
I have a macro I want to run on the worksheets listed in Worksheet10, the reason being is that worksheets are constantly added that need the code run in them. I want to avoid having to go into the code every time I want to add a new worksheet to run in the macro.
What I was trying to do is create a dynamic array that counts the # of items in worksheet 10 and dims the array to that size. Then it would populate the array with the values from the list. Last it would loop the code through all worksheets in that dynamic array.
Anyone help me please?
Thanks,
Kareem
Bookmarks