Meine Frage ist: Kann man nach Farben per Code sortieren?
Oder kann ich per Code z.B. in der Spalte H nach der Farbe Gelb (Color 6) suchen?
Gruss Volker
Sub farbe()
Dim i As Range
For Each i In Range("H:H")
If i.Interior.ColorIndex = 6 Then MsgBox "Zeile " & i & " ist gelb"
Next i
End Sub
GrußSub Farben()
Dim Zei As Long, Z As Long
Application.ScreenUpdating = False
Zei = Cells(Rows.Count, 1).End(xlUp).Row
For Z = 2 To Zei
Cells(Z, 10) = IIf(Cells(Z, 8).Interior.ColorIndex = 6, 1, 0)
Next Z
Range("J1") = "Index"
Columns("A:J").Sort key1:=Range("J2"), order1:=xlAscending, header:=xlYes
Columns(10).ClearContents
Application.ScreenUpdating = True
End Sub