Hello Tim,
If you right click the worksheet tab and choose View Code. Then use this code.
Private Sub Worksheet_Activate()
ApplyFormatting UsedRange
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
ApplyFormatting Target
End Sub
Sub ApplyFormatting(rnge As Range)
For Each cl In rnge.Cells
If cl.Value = 0 Then
cl.Font.Color = vbWhite
Else
cl.Font.Color = vbBlack
End If
Next
End Sub
When the sheet is activated the formatting will be applied to the whole sheet. After that, the formatting will only work on any changes made by the user. This will help speed up execution time.
HTH,
Dax.
Always explore the simple option...
Hiya
a much simpler method which will achieve the same result would be to set Excel so that zero values are not displayed.
To do this, go to Tools/Options and on the View tab, uncheck the Zero Values option.
Doing this means that cells containing a value of zero are "blank", and so will achieve the same result as formatting in white.
JAF
Re: Always explore the simple option...
Who said that his background was white? It probably is though!
Regards,
Dax.