Good Morning All,
I am trying to remove a line if a cell is a certain colour (in this case, yellow). This is the code I thought I'd use, but it doesn't seem to like it.
Set JerWB = Workbooks("Test.xls").Worksheets("use")
rr = 1
If (JerWB.Cells(rr, 1).ColorIndex = 6) Then
JerWB.Cells(rr, 1).EntireRow.Delete Shift:=xlShiftUp
Else
rr = rr + 1
End If
I am trying to remove a line if a cell is a certain colour (in this case, yellow). This is the code I thought I'd use, but it doesn't seem to like it.
Set JerWB = Workbooks("Test.xls").Worksheets("use")
rr = 1
If (JerWB.Cells(rr, 1).ColorIndex = 6) Then
JerWB.Cells(rr, 1).EntireRow.Delete Shift:=xlShiftUp
Else
rr = rr + 1
End If