Highlighting tabs with macro based on a check box in a cell

Johnny Thunder

Well-known Member
Joined
Apr 9, 2010
Messages
693
Office Version
  1. 2016
Platform
  1. MacOS
Hello,

I am trying to have three check boxes next to a drop down that shows (Check boxes)

Viewed = B9 Light yellow
Pending =C9 Red
Completed =D9 Green

And once one of the boxes is checked the tab will change colors.

any ideas?

Thanks guys!
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
I did not understand very well what your objective.
However the code that runs the tab color change is:
Code:
Private Sub CheckBox1_Change()
If CheckBox1 = True Then
ActiveSheet.Tab.Color = 255 'red color
Else
ActiveSheet.Tab.Color = xlNone
End If
End Sub
 
Upvote 0
You should use the Option buttons for this:


Code:
Private Sub Completed_Change()
    
    If Completed.Value = True Then
        
        With ActiveSheet.Tab
            .Color = 222222
            .TintAndShade = 0
        End With
    
    End If
    
End Sub

Private Sub Pending_Change()
    If Pending.Value = True Then
        
        With ActiveSheet.Tab
            .Color = 3333333
            .TintAndShade = 0
        End With
    
    End If
End Sub


Private Sub Viewed_Change()
    
    If Viewed.Value = True Then
        
        With ActiveSheet.Tab
            .Color = 5287936
            .TintAndShade = 0
        End With
    
    End If
    
End Sub
 
Upvote 0
Where would I enter this Macro? I am using Excel 2007? Would it just be a new macro? Cause I entered it in and nothing happens? Please help?
 
Upvote 0

Forum statistics

Threads
1,215,202
Messages
6,123,625
Members
449,109
Latest member
Sebas8956

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