Hier mal mein Code ,mit dem es funktioniert.
Vielleicht braucht jemand diese Funktion.
With SrcWbk.Sheets("Detail")
LastRow = .Cells(.Rows.Count, "AL").End(xlUp).Row
LastCol = .Cells(9, .Columns.Count).End(xlToLeft).Column
Set rng = .Range(.Cells(5, 25), .Cells(LastRow, LastCol))
End With
For Each cell In rng
If cell.Value = "*" Then cell.Interior.ColorIndex = 19
If cell.Value = "." Then cell.Interior.ColorIndex = 19
If cell.Value = "S" Then cell.Interior.Color = RGB(255, 199, 206)
If cell.Value = "P" Then cell.Interior.Color = RGB(255, 199, 206)
If cell.Value = "P" Then cell.Font.Color = RGB(156, 0, 6)
If cell.Value = "S" Then cell.Font.Color = RGB(156, 0, 6)
If cell.Value = "V" Then cell.Interior.ColorIndex = 45
If cell.Value = "C" Then cell.Interior.Color = RGB(0, 176, 80)
If cell.Value = "A" Then cell.Interior.Color = RGB(0, 176, 80)
If cell.Value = "H" Then cell.Interior.Color = RGB(0, 176, 80)
If cell.Value = "Z" Then cell.Interior.Color = RGB(0, 200, 255)
If cell.Value = "N" Then cell.Interior.ColorIndex = 3
Next
Gruss
Mike
|