für eine Tabelle nutze ich folgendes Makro:
Sub einfärben()
For Each Cell In Range("H5:AH16")
If Cell = "SE" Then
Cell.Interior.ColorIndex = 3
Cell.Font.ColorIndex = 3
End If
If Cell = "TW" Then
Cell.Interior.ColorIndex = 4
Cell.Font.ColorIndex = 4
End If
If Cell = "BS" Then
Cell.Interior.ColorIndex = 5
Cell.Font.ColorIndex = 5
End If
If Cell = "SK" Then
Cell.Interior.ColorIndex = 6
Cell.Font.ColorIndex = 6
End If
If Cell = "CN" Then
Cell.Interior.ColorIndex = 7
Cell.Font.ColorIndex = 7
End If
If Cell = "MST" Then
Cell.Interior.ColorIndex = 8
Cell.Font.ColorIndex = 8
End If
If Cell = "SAM" Then
Cell.Interior.ColorIndex = 9
Cell.Font.ColorIndex = 9
End If
If Cell = "Assi" Then
Cell.Interior.ColorIndex = 10
Cell.Font.ColorIndex = 10
End If
Next Cell
End Sub
Bisher muss ich das Makro allerdings jedes Mal per Hand ausführen, wenn sich ein Zellergebnis geändert hat. Gibt es die Möglichkeit, dass das Makro sofort ausgeführt wird, sobald sich ein Zellergebnis in der angegebenen Range ergibt?
Danke für Eure Hilfe und viele Grüße
Michael