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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
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,215,981
Messages
6,128,089
Members
449,418
Latest member
arm56

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