Eloise T
Active Member
A workbook has 3 tabs labeled as follows:
tab 1 as Red, tab 2 as Yellow, and tab 3 as Green
In a VBA I might address the tabs as follows:
If Worksheet.Name <> "Red" And Worksheet.Name <> "Yellow" And Worksheet.Name <> "Green" Then
to eliminate addressing those tabs in the VBA. How would the above line look if I wanted to address the tabs as 1, 2, and 3?
If Worksheet.Name <> "Sheet1" And Worksheet.Name <> "Sheet2" And Worksheet.Name <> "Sheet3" Then
doesn't work.
Thank you in advance for your input.
tab 1 as Red, tab 2 as Yellow, and tab 3 as Green
In a VBA I might address the tabs as follows:
If Worksheet.Name <> "Red" And Worksheet.Name <> "Yellow" And Worksheet.Name <> "Green" Then
to eliminate addressing those tabs in the VBA. How would the above line look if I wanted to address the tabs as 1, 2, and 3?
If Worksheet.Name <> "Sheet1" And Worksheet.Name <> "Sheet2" And Worksheet.Name <> "Sheet3" Then
doesn't work.
Thank you in advance for your input.
Last edited: