Select last column
Hi Martin,
It was completly clear to me.
Sub ColorRowOnYes()
Dim lRow As Long
Dim lCol As Long
For lRow = 2 To 21
If Cells(lRow, 3).Value = "Yes" Then
If IsEmpty(Cells(lRow, 256)) Then
lCol = Cells(lRow, 256).End(xlToLeft).Column
Else
lCol = 256
End If
Range(Cells(lRow, 1), Cells(lRow, lCol)).Interior.ColorIndex = 50
End If
Next
End Sub
HTH,
Wouter
|