Lartk
10-17-2012, 11:30 AM
I am trying to highlight particular cells that have the text "1" but this code is not working...
Sub testing()
With ActiveSheet
lastrow = .Cells(.Rows.Count, "A").End(xlUp).Offset(1000, 0).Row
For i = 4 To lastrow
If .Cells(i, "B").Value = "1" Then
Range.Cells(i, "B").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End If
Next i
End With
End Sub
Sub testing()
With ActiveSheet
lastrow = .Cells(.Rows.Count, "A").End(xlUp).Offset(1000, 0).Row
For i = 4 To lastrow
If .Cells(i, "B").Value = "1" Then
Range.Cells(i, "B").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End If
Next i
End With
End Sub