Automatically Color Tabs Red based on Expiration Date

palcallao

New Member
Joined
Oct 2, 2014
Messages
8
Greetings Mr.Excel community,

Thanks so much for all the help in advance. I have read lot of your posts and the knowledge here is amazing. Alright here is my issue, I need to color each tab red when the contents of E8:E14 and F8:F14 do not have a date posted. I have 26 tabs total in the spreasheet. Thanks again.
 
These last 2 codes? would I put them together?I apologize for my lack of understanding, thanks for being so patient. And when you say "call it"? is that another term for running the code?
So, like I said, you'll have to call it in each sheet. But it is possible. You have a few options:

Workbook Activate
Workbook Deactivate
Workbook Before Close

Worksheet Change
Worksheet Calculate
Worksheet Selection

If you want Worksheet Change, that would be:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)

    colorTabs


End Sub

And then probably change colorTabs to:

Code:
Sub colorTabs()




        With ActiveSheet
            Select Case Application.WorksheetFunction.CountBlank(.Range("E8:F18"))
                Case 0
                    .Tab.Color = xlAutomatic
                Case Else
                    .Tab.Color = 255
            End Select
        End With




End Sub
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
You can put them together, but then if you make a change to one you have to remember to make a change to all the others. It's easier to put the colorTabs() in your module and reference it using the worksheet_chage event.
 
Upvote 0

Forum statistics

Threads
1,215,347
Messages
6,124,421
Members
449,157
Latest member
mytux

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