Auto filling a row

P

phil2006

I need to fill a row with black if the value in the cell in column AL is
the letter "A". How would I do this?


Thanks
 
E

excelent

Sub xColor()
For r = 1 To Range("AL65536").End(xlUp).Offset(1, 0).Row
If Cells(r, 38) = "A" Then
Range("A" & r & ":IV" & r).Interior.ColorIndex = 1 ' The whole Row's
'Cells(r, 38).Interior.ColorIndex = 1 ' Only the cell in AL
End If
Next
End Sub



"phil2006" skrev:
 
J

Jim May

Use Conditional Formatting;

Say you only want to affect rows 5 to 20;

Click in the Rowheader of Row 5 and (dragdown) highlite thru row 20;
Then Menu, CF, Select FormulaIs from drop-down - in box enter =$A5="A"
Format buttom Pattern Select BLACk, and Ok Out

Try it!!
 
Top