Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default macro for Tab colour change

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
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
Change the colour Jaf Excel Worksheet Functions 1 October 16th 09 05:54 AM
macro help to change row colour automatically angel Excel Worksheet Functions 1 July 31st 08 09:12 AM
Change Tab colour using Macro Rajat Excel Worksheet Functions 4 October 24th 06 02:31 PM
change a cell background colour to my own RGB colour requirements Stephen Doughty Excel Discussion (Misc queries) 4 June 16th 06 01:08 PM
Macro button colour change??? Beefyme Excel Worksheet Functions 1 November 19th 04 06:15 PM


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

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

About Us

"It's about Microsoft Excel"