Change Tab colour using Macro
Sub test()
Dim sh As Worksheet
For Each sh In Activeworkbook.Worksheets
If sh.Range("A1").Value < "hello" Then
sh.Tab.ColorIndex = 6
Else
sh.Tab.ColorIndex = -4142
End If
Next sh
End Sub
--
HTH
Bob Phillips
(replace somewhere in email address with gmail if mailing direct)
"Rajat" wrote in message
...
thanx for your help.
But i've another problem, can i extend the Macro to all the sheets of the
workbook.
Say workbook have 30 sheets. can it be done using the same macro.
|