Sub Makro1()
SPALTEN_Hund = Array(2, 4)
SPALTEN_Katze = Array(3, 4)
SPALTEN_Maus = Array(5, 6)
Cells.FormatConditions.Delete
On Error Resume Next
For SPALTE = 2 To 26
For ZEILE = 1 To Columns(SPALTE).SpecialCells(xlCellTypeLastCell).Row
Set test = Nothing
test = Application.WorksheetFunction.Match(SPALTE, SPALTEN_Hund, 0)
If IsNumeric(test) Then
Cells(ZEILE, SPALTE).FormatConditions.Add Type:=xlExpression, Formula1:="=Z" & ZEILE & "S1=""Hund"""
Cells(ZEILE, SPALTE).FormatConditions(Cells(ZEILE, SPALTE).FormatConditions.Count).Interior.ColorIndex = 43
End If
Set test = Nothing
test = Application.WorksheetFunction.Match(SPALTE, SPALTEN_Katze, 0)
If IsNumeric(test) Then
Cells(ZEILE, SPALTE).FormatConditions.Add Type:=xlExpression, Formula1:="=Z" & ZEILE & "S1=""Katze"""
Cells(ZEILE, SPALTE).FormatConditions(Cells(ZEILE, SPALTE).FormatConditions.Count).Interior.ColorIndex = 5
End If
Set test = Nothing
test = Application.WorksheetFunction.Match(SPALTE, SPALTEN_Maus, 0)
If IsNumeric(test) Then
Cells(ZEILE, SPALTE).FormatConditions.Add Type:=xlExpression, Formula1:="=Z" & ZEILE & "S1=""Maus"""
Cells(ZEILE, SPALTE).FormatConditions(Cells(ZEILE, SPALTE).FormatConditions.Count).Interior.ColorIndex = 3
End If
Next ZEILE
Next SPALTE
End Sub