Use VBA to select multiple worksheets based on tab color

drewbny

Board Regular
Joined
Jan 16, 2011
Messages
98
Is there a way you can select multiple worksheets based on tab color, or a way you can select which tabs you want to work with using a list? Using the traditional method of using control and click is too time consuming. Im not proficient in VBA and would like to know how this can be done.
 
Looks like it might well be! Do you just want hidden sheets ignored?

If so, amend the following line of code:-
Code:
    If ws.Tab.ColorIndex = wsColor(0) [COLOR=red][B]And ws.Visible = xlSheetVisible[/B][/COLOR] Then
 
Last edited:
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
How can i modify this macro to select all of the sheets that have coloured tabs? (leaving all of the sheets with uncoloured tabs unselected)
 
Upvote 0
How can i modify this macro to select all of the sheets that have coloured tabs?


The code in post number 3 already does based on the Activesheets tab colour. So select a sheet with the tab colour (it only deals with one color).
 
Upvote 0

Forum statistics

Threads
1,223,098
Messages
6,170,103
Members
452,302
Latest member
TaMere

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top