I need my macro to delete rows containing a red cell.
I started by sorting the column containing red cells so that blank cells were at the top, then manually clicked the top red cell (row 100) and highlighted the rest using Ctrl-Shift-Down. As such, part of my code looks like this:
ActiveWorkbook.Worksheets("Sheet1").ListObjects("Table1").Sort.SortFields.Add2 _
Key:=Range("Table1[[#All],[First Name]]"), SortOn:= _
xlSortOnCellColor, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").ListObjects("Table1").Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=1, Criteria1:=RGB _
(255, 0, 0), Operator:=xlFilterCellColor
Rows("100:150").Select
How can I amend the last part so that my macro detects the red cells then highlights them, so that it'll work regardless of how many cells I have in my sheet?
Thanks in advance.