Hi there,
Been using a VBA to sort duplicates within an Active Sheet that have been marked with the default 'highlight duplicate' cell colour (RGB 255, 199, 206).
All of a sudden my VBA is not working.... (red font is code being highlighted to debug).
Here is the code:
Sub SortDups2()
'
' SortDups2 Macro
'
'
ActiveSheet.Sort.SortFields.Clear
ActiveSheet.Sort.SortFields.Add(Range("I2"), _
xlSortOnCellColor, xlAscending, , xlSortNormal).SortOnValue _
.Color = RGB(255, 199, 206)
With ActiveSheet.Sort
.SetRange Range("A1").CurrentRegion
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Any reasons why all of a sudden it wouldn't be working?
Cheers
Been using a VBA to sort duplicates within an Active Sheet that have been marked with the default 'highlight duplicate' cell colour (RGB 255, 199, 206).
All of a sudden my VBA is not working.... (red font is code being highlighted to debug).
Here is the code:
Sub SortDups2()
'
' SortDups2 Macro
'
'
ActiveSheet.Sort.SortFields.Clear
ActiveSheet.Sort.SortFields.Add(Range("I2"), _
xlSortOnCellColor, xlAscending, , xlSortNormal).SortOnValue _
.Color = RGB(255, 199, 206)
With ActiveSheet.Sort
.SetRange Range("A1").CurrentRegion
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Any reasons why all of a sudden it wouldn't be working?
Cheers