bin leider noch mal da, komme nicht klar, muss mich glaub ich präzisieren: ich möchte nicht nur für eine Bedingung, sondern z.B. für 3 kongret defnierte Bedingungen dieselbe Reaktion erzeugen. Also z.B.: WENN bedingung1 ODER bedingung2 ODER bedingung3 erfüllt ist, DANN ......
Hier der Codeteil, um den es geht:
For e = 2 To ziel ' Schleife für Termine
For t = 2 To 46 Step 4 ' Schleife für Monate
For m = 3 To 33 ' Schleife für Tage pro Monat
If Cells(t, m) = termfei(e) Then ' Wenn Feiertag dann...
Cells(t + 1, m).Interior.ColorIndex = 3 ' ...Zellenfarbe rot
Cells(t + 1, m).Font.ColorIndex = 2 ' ...Schriftfarbe automatisch
Cells(t + 1, m).Font.FontStyle = "Fett" ' ...Schriftschnitt FETT
Cells(t + 1, m) = feit(e) ' ...x eintragen
End If
If Cells(t + 1, m) = "ro" Then
Cells(t + 1, m).Interior.ColorIndex = -4142 ' ...Zellenfarbe automatisch
Cells(t + 1, m).Font.ColorIndex = 32 ' ...Schriftfarbe blau
Cells(t + 1, m).Font.FontStyle = "Fett" ' ...Schriftschnitt FETT
End If
If Cells(t + 1, m) = "fa" Then
Cells(t + 1, m).Interior.ColorIndex = -4142 ' ...Zellenfarbe automatisch
Cells(t + 1, m).Font.ColorIndex = 32 ' ...Schriftfarbe blau
Cells(t + 1, m).Font.FontStyle = "Fett" ' ...Schriftschnitt FETT
End If
If Cells(t + 1, m) = "as" Then
Cells(t + 1, m).Interior.ColorIndex = -4142 ' ...Zellenfarbe automatisch
Cells(t + 1, m).Font.ColorIndex = 32 ' ...Schriftfarbe blau
Cells(t + 1, m).Font.FontStyle = "Fett" ' ...Schriftschnitt FETT
End If
Next m ' Schleifenzähler (For m)
Next t ' Schleifenzähler (For t)
Next e ' Schleifenzähler (For e)
Es funktioniert ja. Aber läßt sich das nicht eleganter schreiben?
Gruß Franz