Hi,
Attached is a workbook where I need to sort column B based on color. I need any cells having green color to be on top. I have the following code but it's not working. I haven't been able to find out why it's not working. Any help will be highly appreciated.
Range("B1").Select
Selection.AutoFilter
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.AutoFilter.SORT. _
SortFields.Clear
ActiveSheet.AutoFilter.SORT. _
SortFields.Add(ActiveCell.Offset(1, 0).Range("A1:A" & LastRow), xlSortOnCellColor, _
xlAscending, , xlSortNormal).SortOnValue.Color = RGB(146, 208, 80)
With ActiveSheet.AutoFilter.SORT
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Selection.AutoFilter
Application.CutCopyMode = False
Bookmarks