Gruppe
Allgemein
Problem
Spalte A soll nach den Farbindizes der Hintergrundfarben sortiert werden.
StandardModule: Modul1
Sub SortColors()
Dim iRow As Integer
Application.ScreenUpdating = False
iRow = 1
Do Until IsEmpty(Cells(iRow, 1))
Cells(iRow, 2).Value = Cells(iRow, 1).Interior.ColorIndex
iRow = iRow + 1
Loop
Range("A1").CurrentRegion.Sort _
key1:=Range("B1"), _
order1:=xlAscending, _
header:=xlNo
Columns("B").ClearContents
Application.ScreenUpdating = True
End Sub