if I have code such as this..
You can see "es" & "etd" are being declared, and set to Jan Week 1 worksheet.
How can I write this to accept for example where I have quite a few more sheets to add.
I have like 50+ sheets I'd like to assign this way. Do I need to set these as an array or is there perhaps an easier way to do it?
"etd" would be the same across all sheets, so I'm trying to learn a bit on how to use the same variant across all the sheets I'm looking for.
Code:
Dim es As Worksheet, etd As Worksheet
Set es = Worksheets("Master Employee List")
Set etd = Worksheets("Jan Week 1")
You can see "es" & "etd" are being declared, and set to Jan Week 1 worksheet.
How can I write this to accept for example where I have quite a few more sheets to add.
Code:
Set etd = Worksheets("Jan Week 1"),("Jan Week 2"),("Jan Week 3"),("Jan Week 4")
I have like 50+ sheets I'd like to assign this way. Do I need to set these as an array or is there perhaps an easier way to do it?
"etd" would be the same across all sheets, so I'm trying to learn a bit on how to use the same variant across all the sheets I'm looking for.
Last edited: