AW: Hilfe ! Zellen einfärben mit bedingung
15.08.2008 15:24:11
Ramses
Hallo
Option Explicit
Sub MarkRange()
Dim tarRange As Range
Dim startCol As Long, endCol As Long, chkCol As Long
Dim startRow As Long
Dim i As Long
'Spalte A
startCol = 1
'bis Spalte L
endCol = 12
'Prüfspalte
chkCol = 13
'Zeile wo mit der Prüfung begonnen werden soll
startRow = 2
'Rot = 3
'Gelb = 6
'Grün = 4
'Schwarz = 1
'Blau = 5
'Orange = 45
'Hellblau = 8
For i = startRow To Cells(Rows.Count, chkCol).End(xlUp).Row
Select Case Cells(i, chkCol).Text
Case "Hallo"
With Range(Cells(i, startCol), Cells(i, endCol)).Interior
.Color = 3
.Parent = xlSolid
End With
Case "A"
With Range(Cells(i, startCol), Cells(i, endCol)).Interior
.Color = 6
.Parent = xlSolid
End With
Case "irgendwas"
With Range(Cells(i, startCol), Cells(i, endCol)).Interior
.Color = 8
.Parent = xlSolid
End With
End Select
Next i
End Sub
Gruss Rainer