PDA

View Full Version : Color Worksheet Tabs



ssinghal
02-07-2008, 08:27 AM
I get an excel report everyday that has aprroximately 100 sheets in it. I want to run a loop on each sheet that checks the name of the tab and if it matches another name then color it blue. So for each sheet it goes through a list of if statements and colors if it matches. Could someone help me set this up?

rory
02-07-2008, 08:40 AM
Something like this - adjust the string as necessary:
Sub colourtabs()
Dim wks As Object
For Each wks In Sheets
If wks.Name Like "Sheet*" Then wks.Tab.ColorIndex = 5
Next wks
End Sub