View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Changing color of tabs

As previously given

Dim sh As Object

Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
For Each sh In ActiveWindow.SelectedSheets
sh.Tab.ColorIndex = 3
Next sh


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Fabrizio" wrote in message
...
I have a macro that I want to change the color of the tabs ( I think it is
tab in english, I am referring to the small part of the worksheet that
displays the name etc..). When writing the code I want to select a number

of
tabs and then change their color instead of writing code for every one of
them. However I dont know how to write it.

Private Sub Workbook_Open()
Sheets(Array("Tracking Error", "Mod Dur", "Indata")).Select
With Selection.Tab
.ColorIndex = 4
End With

My code does not work. I do not want to record a macro since I want to
change it later...Please help me!