ich befinde mich in Zelle a1 und möchte in Spalte a die nächste Zelle finden in der die Schriftfarbe nicht grün ist (If not colorindex = 10)
Wahrscheinlich brauche ich eine Schleife, aber ich bekomme es nicht hin,
Gruß Basti
Sub check()
Dim lr as Integer
Dim i as integer
lr = Cells(65536,1).end(xlup).row
For i = 1 to lr
if cells(i,1).colorindex <> 10 then
msgbox Cells(i,1).Address & " ist nicht grün"
Exit sub
end if
next i
End Sub
Private Sub CommandButton3_Click()
Dim s As Range
Set s = Range("b:b").Find(UserForm4.Caption)
If s.Offset(1, 0).Font.ColorIndex = 10 Then
Dim lr As Integer
Dim i As Integer
Dim anfang As Integer
anfang = s.Select
lr = Cells(200, 2).End(xlUp).Row
For i = anfang To lr
If Cells(i, 2).Font.ColorIndex <> 10 Then
MsgBox Cells(i, 2).Address & " ist nicht grün"
Exit Sub
End If
Next i
End if
End Sub
Die erweiterte Suchfunktion hilft dir, gezielt die besten Antworten zu finden
Suche nach den besten AntwortenEntdecke unsere meistgeklickten Beiträge in der Google Suche
Top 100 Threads jetzt ansehen