I am trying to highlight cells in an individual column, and it errors on the Color:=RGB(255, 255, 0 portion of this code:
' Sort column A by color (highlighted cells at the top)
ws.Sort.SortFields.Clear
ws.Sort.SortFields.Add Key:=ws.Range("A1:A" & lastRow), SortOn:=xlSortOnCellColor, Order:=xlAscending, DataOption:=xlSortNormal, Color:=RGB(255, 255, 0)
With ws.Sort
.SetRange ws.Range("A1:I" & lastRow)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Anyone have suggestions on how to fix Color:= ???
' Sort column A by color (highlighted cells at the top)
ws.Sort.SortFields.Clear
ws.Sort.SortFields.Add Key:=ws.Range("A1:A" & lastRow), SortOn:=xlSortOnCellColor, Order:=xlAscending, DataOption:=xlSortNormal, Color:=RGB(255, 255, 0)
With ws.Sort
.SetRange ws.Range("A1:I" & lastRow)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Anyone have suggestions on how to fix Color:= ???