I have this code that unhides a column and then select using autofilter a value
The thing is that when there are no entries for RRP (as I don't know which sheets will have it as I loop sheet), it highlights the rows red, even if there is nothing there ? it highlights it RED, and I only need that to highlight for rows with value of RRP.
What is the best way to edit this so that if there is no rows with values of RRP, it just skips to end of this code ?
With Range("A6:AH" & lr) ' SORT #4 When GTP is blank and Done.value=X, then SORT and highlight light purple
On Error Resume Next
Columns("R:T").Select
Range("T1").Activate
Selection.EntireColumn.Hidden = False
Range("S6").Select
Selection.AutoFilter
Selection.AutoFilter Field:=19, Criteria1:="RRP"
.Sort Key1:=Range("C7"), Order1:=xlAscending, Key2:=Range( _
"D7"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase _
:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal
Range("A7:AH" & lr).Select
With Selection.Interior
.ColorIndex = 3 ' RED
.Pattern = xlSolid
Range("AI7:AI" & lr).Value = 4
End With
.AutoFilter ' turn the autofilter off on the last sort ( next month we have to add a 4th sort (RED-for RR that make it into the sheet)
End With
The thing is that when there are no entries for RRP (as I don't know which sheets will have it as I loop sheet), it highlights the rows red, even if there is nothing there ? it highlights it RED, and I only need that to highlight for rows with value of RRP.
What is the best way to edit this so that if there is no rows with values of RRP, it just skips to end of this code ?
With Range("A6:AH" & lr) ' SORT #4 When GTP is blank and Done.value=X, then SORT and highlight light purple
On Error Resume Next
Columns("R:T").Select
Range("T1").Activate
Selection.EntireColumn.Hidden = False
Range("S6").Select
Selection.AutoFilter
Selection.AutoFilter Field:=19, Criteria1:="RRP"
.Sort Key1:=Range("C7"), Order1:=xlAscending, Key2:=Range( _
"D7"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase _
:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal
Range("A7:AH" & lr).Select
With Selection.Interior
.ColorIndex = 3 ' RED
.Pattern = xlSolid
Range("AI7:AI" & lr).Value = 4
End With
.AutoFilter ' turn the autofilter off on the last sort ( next month we have to add a 4th sort (RED-for RR that make it into the sheet)
End With