Macro Help! Change Cell Color for Errors and/or Zero Values to White - Across Whole Workbook

RLBrown

New Member
Joined
Aug 6, 2018
Messages
7
Hello Macro Wizards & Wizardesses...

I have a very intricate workbook with several dynamic pivot tables, slicers, links, etc. I've applied conditional formatting to each sheet to handle turning the font color of cells containing either errors or zero values to WHITE which works great until I refresh the pivot tables. I have never been able to learn to write macros but wonder a macro could be the solution to my issue.

Could someone help me with a macro that changes the font color to white (across the workbook) if the cell value is either an error or a zero value?
 

Some videos you may like

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

ravishankar

Well-known Member
Joined
Feb 23, 2006
Messages
3,566
try the following codes
Sub banna()
For a = 1 To Sheets.Count
x = Sheets(a).Cells(Rows.Count, 1).End(xlUp).Row
y = Sheets(a).Cells(1, Columns.Count).End(xlToLeft).Column
For b = 1 To x
For c = 1 To y
If IsError(Sheets(a).Cells(b, c)) = True Then
ElseIf Sheets(a).Cells(b, c) = "0" Then
Sheets(a).Cells(b, c).Font.ColorIndex = 2
Else
End If
Next c
Next b
Next a
MsgBox "complete"
End Sub
it does not seem to pickup error cells. will continue trying on it.
Ravi shankar
 

Watch MrExcel Video

Forum statistics

Threads
1,108,753
Messages
5,524,641
Members
409,597
Latest member
Dannydev

This Week's Hot Topics

Top