If I use this code in an Excel 97 macro it works. If I put it behind a button, it doesen’t. I get a Runtime 1004 error – unable to set the Color property of the Font class.
The macro hides all cells with either an “x” or a “y”. I would like toget it to work using a button.
Any thoughts?
Dim Row As Integer
Dim Col As Integer
For Col = 1 To 25
For Row = 1 To 100
If Cells(Row, Col).Text = “x” Then
Cells(Row, Col).Font.Color = RGB(255, 255, 255)
ElseIf Cells(Row, Col).Text = “y” Then
Cells(Row, Col).Font.Color = RGB(225, 225, 225)
Else
Cells(Row, Col).Font.Color = RGB(0, 0, 0)
End If
NextRow = 2
Next
….thanks in advance………..Herb