Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 577
Default tab colors in 2003

Hi I have a workbook which has some 22 tabs. The first worksheet is called
"Cover Page" and it has a list of all the other tabs (tab names are not
constant) in range A10:A30. The users can change the colors of individual
cells in range A10:A30. What I would like to do is change the color of the
tab to match the color of its corresponding cell in range A10:A30 on "Cover
Page"

Excel version is 2003, can anyone help me out?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default tab colors in 2003

Hi

Give this a shot:


Private Sub Worksheet_Deactivate()

Dim i As Integer

For i = 1 To 21

ThisWorkbook.Worksheets(i + 1).Tab.ColorIndex =
Sheets(1).Range("A10:A30").Cells(i, 1).Interior.ColorIndex

Next

End Sub


You put the code in the code for the Cover page, *not* somewhere else (for
instance in a module).

Whenever you leave the Cover page sheet, the colors of the sheets will be
updated.

--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"Scott" wrote:

Hi I have a workbook which has some 22 tabs. The first worksheet is called
"Cover Page" and it has a list of all the other tabs (tab names are not
constant) in range A10:A30. The users can change the colors of individual
cells in range A10:A30. What I would like to do is change the color of the
tab to match the color of its corresponding cell in range A10:A30 on "Cover
Page"

Excel version is 2003, can anyone help me out?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 577
Default tab colors in 2003

Worked a treat, ta very much!

"Wigi" wrote:

Hi

Give this a shot:


Private Sub Worksheet_Deactivate()

Dim i As Integer

For i = 1 To 21

ThisWorkbook.Worksheets(i + 1).Tab.ColorIndex =
Sheets(1).Range("A10:A30").Cells(i, 1).Interior.ColorIndex

Next

End Sub


You put the code in the code for the Cover page, *not* somewhere else (for
instance in a module).

Whenever you leave the Cover page sheet, the colors of the sheets will be
updated.

--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"Scott" wrote:

Hi I have a workbook which has some 22 tabs. The first worksheet is called
"Cover Page" and it has a list of all the other tabs (tab names are not
constant) in range A10:A30. The users can change the colors of individual
cells in range A10:A30. What I would like to do is change the color of the
tab to match the color of its corresponding cell in range A10:A30 on "Cover
Page"

Excel version is 2003, can anyone help me out?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
2003 colors in 2007? Scott A[_2_] Excel Worksheet Functions 0 July 20th 09 05:45 PM
excel 2007 colors do not match excel 2003 colors. Tom's Travails' Excel Discussion (Misc queries) 0 July 17th 08 01:56 AM
Count Colors in 2003 Whois Clinton Excel Worksheet Functions 3 May 20th 08 03:23 PM
2007 Colors - I want 2003 Colors Austin22 Excel Discussion (Misc queries) 0 October 16th 07 02:49 PM
Colors with EXCEL 2003 Bernard Deligny Excel Discussion (Misc queries) 2 January 13th 05 10:51 PM


All times are GMT +1. The time now is 01:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"