Selected Answer
Hello CharlieB and welcome to the forum.
Don't think of it as a simple question. If you don't ask you will not learn; and with Excel and VBA the learning never stops
You've got the right idea but some wrong syntax. Also, your code has the macro checking every cell in column "A". It is better and faster to only check the used cells. To that end you can use this code:
Sub New_Clear_Rows()
' macro written by WillieD24 for teachexcel.com
' this will remove entire row fill colour based on cell value
Dim LR_A As Long
Dim i As Long
' find last used row in column "A"
LR_A = Cells(Rows.Count, 1).End(xlUp).Row ' find last used row
i = 1 ' used for row number
Application.ScreenUpdating = False ' allows macro to run faster
Do Until i > LR_A ' only check used cells - faster than entire column
If Cells(i, 1).Value = 1 Then
Rows(i).Interior.ColorIndex = xlNone
End If
i = i + 1 ' increment row number
Loop
Application.ScreenUpdating = True
End Sub
Update June 13/23 :
While waiting for you to respond I corrected the minor errors in your code (changes in bold)
Sub Clear_Rows_Updated()
' macro updated by WillieD24 for teachexcel.com
' this will remove entire row fill colour based on cell value
Dim icell As Range
Dim R As Long
R = 1
Set icell = Cells(R, 1)
For Each icell In Range("A:A")
If icell.Value = 1 Then
Rows(R).Interior.ColorIndex = -4142
End If
R = R + 1
' this next line was added as a "stop" - replace "10" with the row number of your last used row
If R > 10 Then Exit Sub
Next icell
End Sub
I have also attached a sample file with Sheet1 using my code and Sheet2 using the updated version of your code. (just click the "buttons" on each sheet)
Hope this helps; if so please mark my answer as selected.
Cheers :-)