Conditional formatting based on whether a specific sheet name is present

SquareJerBear

New Member
Joined
Jan 27, 2020
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have a series of specific templates that are being added to a workbook.

I would like to highlight a cell in the first sheet of the workbook if the workbook currently has a worksheet by that name present.

For example, if I add a template named "Saturday" to the worksheet, I would like a cell on the first sheet to highlight to indicate that this sheet is present.

Any ideas?
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
I'm not sure if you can do that with conditional formatting. But his macro should do it. Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for the sheet containing the cell you want highlighted and click 'View Code'. Paste the macro into the empty code window that opens up. Change the range (in red) to match the cell in question. Close the code window to return to your sheet. The macro is triggered automatically when you activate the sheet.
Rich (BB code):
Private Sub Worksheet_Activate()
    If Evaluate("isref('" & Range("A1").Value & "'!A1)") Then
        Range("A1").Interior.ColorIndex = 3
    Else
        Range("A1").Interior.ColorIndex = xlNone
    End If
End Sub
 
Upvote 0
Assuming your sheet names in col A, select A1 to end of data in col A & use this formula in conditional formatting
=ISREF(INDIRECT("'"&A1&"'!A1"))

Change the red A1 to reference the first cell in the applies to range
 
Upvote 0

Forum statistics

Threads
1,223,952
Messages
6,175,594
Members
452,654
Latest member
mememe101

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