Conditional worksheet tab color????

bobmc

Board Regular
Joined
Mar 13, 2002
Messages
142
Is it possible to have a worksheet's tab color change based on whether or not any information has been entered into any of its cells?

Any help is greatly appreciated!!!

Thanks.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Place this in the Private module of the Worksheet.


Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Me.tab.Color.Index = 6
End If
End Sub
 
Upvote 0
After placing the above code into a new worksheet to test it, then entering a number in one of the cells covered by the range, I got a "runtime error 424 - Object required".

When I go to DeBug, the line with "Me.Tab.Color.Index = 6" is hilighted. I am trying to do this with Excel 2002 rather than XE as prescribed above.

Any ideas?

Thanks
 
Upvote 0
HI

To (dont know how tot say.. repeat! again!)

Dave saying on XP this is coded E2002, but there is no 2002 as such.... Office 98 is true and so is 2001 these are not for this board and not considered...

should be ok you siad 2002 you mean PC version XP not PC version 2000? the others are APPLE MAC conversions, ermm Apple mac programms.
 
Upvote 0
Well...

I am running Excel on a PC and when I go to the "help" menu and click on "about", it says I'm running Excel 2002.
 
Upvote 0
Hi

Well you bring good news, Excel 2002 in the help file ie about help abbout is readingg Excel 2002 this is fine you ok XP.

Let me expalin!

Its a Microsoft thing, need i say any more, the code dave provided should be ok....

so lost, all i can suggerst is atler the code line that bugs in debug and edeit to suite,,,, like i say should be fine,.
 
Upvote 0
Was able to make it work with a little bit of a change.

Note the third line contains "ColorIndex" instead of "Color.Index"

All's well!

Thanks for the Help!
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,557
Latest member
richa mishra

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top