Can Do
Changing the colour of the Tab
Goto Guest book sign in page [Home]
A common request among Excel users (Especially users coming from Lotus 123) has been for the ability to colour the worksheet tabs.

This has finally come about through the release of XP. Prior versions could NOT do this. Here is a hack, that will colour the Tabs !!

Please note, this is NOT for practical use, it is just for display....so if someone says it can't be done, show them this :-)

Be warned, it changes your system colours.

Copyright © 2002. XcelFiles. All Rights Reserved. Ivan F Moala
Change Worksheet Tab Colour:

The following code is just for show, have a look below;
Please Note: This code was tested on Win98 Xl2000 & Xp Xl2000 with no side affects,
If however your system gets out ( colours not reset back to normal, then Close down your
system) this should rest it back. If not then you may have to reset your system back manually.
This can be done via the Windows Desktop > Appearance > display properties >
Change the Application Background colour.










































If someone tells you you cannot colour Excel97 / 2000 Tabs (Version < Xp > 95) then show them this. Note it is not for practical use, just an example of using the system colors.

Get example workbook Here






'// Routine goes in the ThisWorkBook Object

'// Start

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
ChangeTab_Colour
End Sub

'// End


'// Routine goes into a Standard Module

Option Explicit

'// Routine to change the colour of the Spreadsheet Tabs


'// API's for System Colours
Private Declare Function GetSysColor Lib "user32" ( _
ByVal nIndex As Long) As Long

Private Declare Function SetSysColors Lib "user32" ( _
ByVal nChanges As Long, _
lpSysColor As Long, _
lpColorValues As Long) As Long

'// Define Colour Constant
Private Const COLOR_WINDOW = 5

Sub ChangeTab_Colour()
Dim Kolor As Long
Dim CurKolor As Long
Dim R As Integer, G As Integer, B As Integer

'// Initialize random-number generator.
Randomize
'// Generate random value between 0 and 255.
R = Int(255 * Rnd)
G = Int(255 * Rnd)
B = Int(255 * Rnd)

'// Try these if you want Basic Colours
'// ===============================================
'// Black 0 0 0 || Blue 0 0 255
'// Green 0 255 0 || Cyan 0 255 255
'// Red 255 0 0 || Magenta 255 0 255
'// Yellow 255 255 0 || White 255 255 255
'// ===============================================
CurKolor = GetSysColor(COLOR_WINDOW)

With Application
.ScreenUpdating = False
'// color it Randomly
Kolor = SetSysColors(1, COLOR_WINDOW, RGB(R, G, B))
ShSet
.ScreenUpdating = True
MsgBox "Tab colour has changed!", vbInformation + vbSystemModal, _
"Tab Colour Hack "
.ScreenUpdating = False
ShReset
'// Restore to Default
Kolor = SetSysColors(1, COLOR_WINDOW, CurKolor)
.ScreenUpdating = True
End With

End Sub

Sub ShSet()
Dim x As Double

Cells.Select
With Selection
.Interior.ColorIndex = 2
.Interior.Pattern = xlSolid
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
End With
For x = 7 To 12
With Selection.Borders(x)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
Next
[A1].Select
End Sub

Sub ShReset()
Cells.Select
With Selection
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
.Interior.ColorIndex = xlNone
End With
[A1].Select
End Sub
They said it couldn't be done
If you're the kind of person that's always up to date on computer technology and enjoy learning about coding, you should use your computer knowledges to help others. Assist family members who are buying a computer, or help a sibling find the best free music online.