simple tab color change based on any entry of any sheet

esrv303

New Member
Joined
Feb 24, 2024
Messages
9
Office Version
  1. 365
Platform
  1. Windows
I have multiple sheets with various names. User would like tab color to change to (example:red) if ANY entry is made to any cell on that sheet. I have no code experience with excel....thanks
 
Do you want the tab colour removed if you clear any cell?
Thanks for your patience....let me ask a different way...
If I open my design workbook with multiple sheets....let's say I make 5 changes to one of my sheets....sheet tab is red.
Now if I clear 3 or 4 of those entries, sheet tab remains red, but if I clear all 5 (back to the start) , sheet tab will return to no color
 
Upvote 0

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
I would have to use a helper cell to keep track of the number of changes you make. What is the last used column in your sheets?
 
Upvote 0
Try:
VBA Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    Application.EnableEvents = False
    If Target <> "" Then
        Range("BC1").Value = Range("BC1").Value + 1
        ActiveSheet.Tab.Color = vbRed
    Else
        Range("BC1") = Range("BC1") - 1
        If Range("BC1") = 0 Then
            ActiveSheet.Tab.Color = xlNone
        End If
    End If
    Application.EnableEvents = True
End Sub
 
Upvote 0
Try:
VBA Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    Application.EnableEvents = False
    If Target <> "" Then
        Range("BC1").Value = Range("BC1").Value + 1
        ActiveSheet.Tab.Color = vbRed
    Else
        Range("BC1") = Range("BC1") - 1
        If Range("BC1") = 0 Then
            ActiveSheet.Tab.Color = xlNone
        End If
    End If
    Application.EnableEvents = True
End Sub
Hmm? sorry, I appear to be getting out of my league. However I did return to your original code which worked well...but now it doesn't work??
Here it is again from your post. thanks

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
ActiveSheet.Tab.Color = vbRed
End Sub
 
Upvote 0
Try closing and restarting Excel.
That did it!! Thanks much for the help and patience. I will just open file and "save as" a new file b4 editing.....then when I reopen the original file, the tabs will already be white>
 
Upvote 0

Forum statistics

Threads
1,223,247
Messages
6,171,004
Members
452,374
Latest member
keccles

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