Jack
Member
Hi all
I have a large Workbook with about 60 worksheets. But of these I have only 20 or so that have to be updated with new data.
Can I or how can I create an object of these 20 worksheets which I need to define by tab name as the index numbers for these sheets are not in one group. I know I could change the names to say end in "Data" and then use Right(wsname,4) = "data" but this is not my workbook and ideally I would prefer to leave it as is. I want to refer to this object in a For each loop ws i.e. for each ws in ...
After a fair bit of googling I am not finding much on this topic. I tried an approach a few days back that didn't work - it was something like...
Dim DataWS as variant
Dim ws as worksheet
DataWS = ({"Sheet1"},{"sheet15"}, {and so on})
for each ws in DataWS
my code
next ws
Was I on the right track?
Thanks
John
I have a large Workbook with about 60 worksheets. But of these I have only 20 or so that have to be updated with new data.
Can I or how can I create an object of these 20 worksheets which I need to define by tab name as the index numbers for these sheets are not in one group. I know I could change the names to say end in "Data" and then use Right(wsname,4) = "data" but this is not my workbook and ideally I would prefer to leave it as is. I want to refer to this object in a For each loop ws i.e. for each ws in ...
After a fair bit of googling I am not finding much on this topic. I tried an approach a few days back that didn't work - it was something like...
Dim DataWS as variant
Dim ws as worksheet
DataWS = ({"Sheet1"},{"sheet15"}, {and so on})
for each ws in DataWS
my code
next ws
Was I on the right track?
Thanks
John