Ampelkonto / Bedingte Fromatierung
24.08.2003 13:28:30
Erich M.
hallo Hajo,
meine Versuche einen Code von Hajo abzuändern sind leider gescheitert,
weshalb ich Hilfe benötige.
Für die Darstellung eines Ampelkontos (Arbeits-Zeitguthaben in verschiedenen
Größen) benötige ich eine Bedingte Formatierung, für die ich den Code von
Hajo verwende:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim RaBereich As Range, RaZelle As Range, RaBereich2 As Range
Set RaBereich = Range("b2:G50")
For Each RaZelle In Range(Target.Address)
If Not Intersect(RaZelle, RaBereich) Is Nothing Then
Select Case RaZelle.Value
Case -50 To 0, 1
RaZelle.Font.ColorIndex = 15
RaZelle.Font.FontStyle = "Fett"
RaZelle.Font.Size = 14
Case 0, 1 To 20
RaZelle.Font.ColorIndex = 3
RaZelle.Font.FontStyle = "Fett"
RaZelle.Font.Size = 14
Case 20, 1 To 50
RaZelle.Font.ColorIndex = 5
RaZelle.Font.FontStyle = "Fett"
RaZelle.Font.Size = 14
Case 50, 1 To 200
RaZelle.Font.ColorIndex = 9
RaZelle.Font.FontStyle = "Fett"
RaZelle.Font.Size = 14
Case 201 To 500
RaZelle.Font.ColorIndex = 7
RaZelle.Font.FontStyle = "Fett"
RaZelle.Font.Size = 14
Case Else
RaZelle.Font.ColorIndex = 0
End Select
End If
Next RaZelle
Set RaBereich = Nothing
End Sub
Code eingefügt mit: Excel Code Jeanie
Soweit kein Problem. Jetzt muss ich aber erreichen, dass in
Abhängigkeit in Vollzeit (VZ) oder Teilzeit (TZ) das Guthaben
mit einer unterschiedlichen Formatierung erscheint. Sämtliche
Versuche mit IF oder "RaBereich2" zu erstellen sind gescheitert.
Wer hat eine Idee, nachstehend ein Tabellenausschnitt: