Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. Please help me! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Fabrizio,
I don't use a version of Excel that supports that, but have you tried recording a macro whilst you make these changes ? NickHK "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. Please help me! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. Please help me! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The recorder doesn't help much in this instance.
Also, I doubt if the Workbook_Open event is the proper place for the code.... Sub OverTheRainbow() Dim objSht As Object For Each objSht In ActiveWindow.SelectedSheets objSht.Tab.ColorIndex = 4 Next End Sub -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "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. Please help me! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run Macro when changing tabs | Excel Discussion (Misc queries) | |||
CANNOT COLOR MY WORKSHEET TABS, TAB COLOR NOT IN FORMAT | Excel Worksheet Functions | |||
My excel 2003 wont let me fill cells with color or color the tabs. | New Users to Excel | |||
Changing colors of tabs | Excel Discussion (Misc queries) | |||
Macro for changing tabs | Excel Programming |