mahmed1
Well-known Member
- Joined
- Mar 28, 2009
- Messages
- 2,302
- Office Version
- 365
- 2016
- Platform
- Windows
Hi all
I have created a loop to go though all sheets except a few
but im concerned that more sheets might get added where ill need to ignore them so i have created a range on my refsheet that list all the sheetnames i want to loop through and NOT avoid
how do i change this line of code:
change to
this way i can always loop through sheets that i want that are listed in my sheetlookup range
I have created a loop to go though all sheets except a few
but im concerned that more sheets might get added where ill need to ignore them so i have created a range on my refsheet that list all the sheetnames i want to loop through and NOT avoid
how do i change this line of code:
Code:
dim ws as worksheet
for each ws in thisworkbook.workheets
if ws.name <>”sheetname” and ws.name <> “sheetname2” then
’do something with that worksheet
A = ws.name ‘etc
end if
next ws
Code:
for each ws in array(SheetLookupRange)
A = ws.name etc
next ws
Last edited by a moderator: