Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This is what i have but the problem is when i type something in cell the Tab
changes colour this is good & when i clear cell i want Tab to go back to its original colour is this possible Private Sub Workbook_SheetChange(ByVal Sh As Object, _ ByVal Target As Range) If Intersect(Target, Range("B300")) Is Nothing Then Exit Sub ActiveSheet.Tab.ColorIndex = 15 End Sub |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You could try this...
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) If Intersect(Target, Range("B300")) Is Nothing Then ActiveSheet.Tab.ColorIndex = 15 Else ActiveSheet.Tab.ColorIndex = [put original colorindex here] End if End Sub Hope it helps... -- Kind regards Rik "Mike" wrote: This is what i have but the problem is when i type something in cell the Tab changes colour this is good & when i clear cell i want Tab to go back to its original colour is this possible Private Sub Workbook_SheetChange(ByVal Sh As Object, _ ByVal Target As Range) If Intersect(Target, Range("B300")) Is Nothing Then Exit Sub ActiveSheet.Tab.ColorIndex = 15 End Sub |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Mike,
Try this Private Sub Workbook_SheetChange(ByVal Sh As Object, _ ByVal Target As Range) If Intersect(Target, Range("B300")) Is Nothing Then Exit Sub Select Case Target.Value Case Is = "" ActiveSheet.Tab.Color = xlAutomatic Case Else ActiveSheet.Tab.Color = 15 End Select End Sub Mike "Mike" wrote: This is what i have but the problem is when i type something in cell the Tab changes colour this is good & when i clear cell i want Tab to go back to its original colour is this possible Private Sub Workbook_SheetChange(ByVal Sh As Object, _ ByVal Target As Range) If Intersect(Target, Range("B300")) Is Nothing Then Exit Sub ActiveSheet.Tab.ColorIndex = 15 End Sub |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
An elementary error in my code, should have been:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) If Intersect(Target, Range("B300")) Is Nothing Then Exit Sub If Target.Value < "" Then ActiveSheet.Tab.ColorIndex = 15 Else ActiveSheet.Tab.ColorIndex = [original ColorIndex] End If End Sub With thanks to Mike H's answer to make me realise this... -- Kind regards Rik "Rik_UK" wrote: You could try this... Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) If Intersect(Target, Range("B300")) Is Nothing Then ActiveSheet.Tab.ColorIndex = 15 Else ActiveSheet.Tab.ColorIndex = [put original colorindex here] End if End Sub Hope it helps... -- Kind regards Rik "Mike" wrote: This is what i have but the problem is when i type something in cell the Tab changes colour this is good & when i clear cell i want Tab to go back to its original colour is this possible Private Sub Workbook_SheetChange(ByVal Sh As Object, _ ByVal Target As Range) If Intersect(Target, Range("B300")) Is Nothing Then Exit Sub ActiveSheet.Tab.ColorIndex = 15 End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Change the colour | Excel Worksheet Functions | |||
macro help to change row colour automatically | Excel Worksheet Functions | |||
Change Tab colour using Macro | Excel Worksheet Functions | |||
change a cell background colour to my own RGB colour requirements | Excel Discussion (Misc queries) | |||
Macro button colour change??? | Excel Worksheet Functions |