Schleifenfehler FOR - NEXT
30.11.2006 14:34:43
Matthias
Ich möchte gerne die Zellen in einem Bereich überprüfen und entsprechend formatieren. Folgender Code bringt mir aber ständig die Fehlermeldung "NEXT ohne FOR", jedoch weiß ich nicht wieso?
Dim MZelle As Range
Dim MBereich As Range
Set MBereich = Range("S13:AC17")
For Each MZelle In Bereich
If MZelle.Value MZelle.Font.ColorIndex = 3
Else
If MZelle.Value >= 0.7 And MZelle.Value MZelle.Font.ColorIndex = 4
Else
If MZelle.Value > 0.9 And MZelle.Value MZelle.Font.ColorIndex = 5
Else
If MZelle.Value > 1.1 And MZelle.Value MZelle.Font.ColorIndex = 6
Else
If MZelle.Value > 1.5 Then
MZelle.Font.ColorIndex = 7
End If
Next MZelle