According to the attachment a VBA demonstration for the Button 2 :
PHP Code:
Sub Macro2()
Dim R&, C&, oCol As New Collection
With ActiveSheet.AutoFilter.Sort
.SortFields.Clear
On Error Resume Next
For R = 2 To .Rng.Rows.Count
C = .Rng(R, 1).Interior.Color
Err.Clear
oCol.Add C, Str(C)
If Not Err.Number Then .SortFields.Add(.Rng(1), 1, 1, , 0).SortOnValue.Color = C
Next
On Error GoTo 0
Set oCol = Nothing
.Header = 1
.Apply
.SortFields.Clear
End With
End Sub
► Do you like it ? ► ► So thanks to click on bottom left star icon ? ★ Add Reputation ? ! ◄ ◄
Bookmarks