Apply Conditional Format to all sheets in same workbook

D

Der Musensohn

Is there a way to apply a conditional rule to all of the worksheets in a
workbook? In other words, the cell range and format is the same for each
sheet but I'd prefer not to create the rule for 40 pages.

Thank you in advance.
 
J

Jim Thomlinson

A CF is a format like any other format. Create one page and then copy and
paste to the rest of the pages...
 
D

Der Musensohn

Thank you Jim. The problem is that I already have individual data on each
worksheet. Specifically what I'm trying to do is hide all zeros from each
page for a specific cell range. I had simply formatted all zeros to have a
white font color. If you know of a macro or formatting code of some sort I
have some experience working with codes. I'd need to know where to paste it
and than I can make specifice reference changes after that.

Thanks.
 
G

Gord Dibben

Sub white_zero()
Dim WS As Worksheet
For Each WS In ThisWorkbook.Worksheets
For Each c In WS.Range("A1:B20")
If c.Value = 0 Then
c.Font.ColorIndex = 2
End If
Next c
Next WS
End Sub


Gord Dibben MS Excel MVP
 
D

Der Musensohn

Got it. Thanks Gord.

Gord Dibben said:
Sub white_zero()
Dim WS As Worksheet
For Each WS In ThisWorkbook.Worksheets
For Each c In WS.Range("A1:B20")
If c.Value = 0 Then
c.Font.ColorIndex = 2
End If
Next c
Next WS
End Sub


Gord Dibben MS Excel MVP




.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top