Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
392to396
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
392to396
392to396
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

Bedingte Formatierung > 3

Bedingte Formatierung > 3
03.03.2004 16:33:16
Silvia
Hallo Halli
Ich werde mich in nächster Zeit wohl öfter hier sehen lassen, weil ich gerade einen Dienstplan bastel.
Nun meine erste Frage: Wie kann ich mehr als 3 bedingte Formatierungen definieren?
Herzlichen Dank!
Silvia

8
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Bedingte Formatierung > 3
03.03.2004 16:43:33
xXx
Hallo,
nur mit VBA.
Ein Beispiel findest du auf Hajo_Zi's Seite.
Gruß aus'm Pott
Udo
AW: Bedingte Formatierung > 3
03.03.2004 16:46:14
Willie
Hallo Silvia das geht nur mit VBA und zwar so!

Sub Makro1()
For i = 1 To 30
If Cells(i, 5).Value <= 60 Then
Cells(i, 5).Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="40"
Selection.FormatConditions(1).Interior.ColorIndex = 9
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="50"
Selection.FormatConditions(2).Interior.ColorIndex = 4
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="60"
Selection.FormatConditions(3).Interior.ColorIndex = 32
Else
Cells(i, 5).Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="65"
Selection.FormatConditions(1).Interior.ColorIndex = 22
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="70"
Selection.FormatConditions(2).Interior.ColorIndex = 12
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="75"
Selection.FormatConditions(3).Interior.ColorIndex = 33
End If
Next
End Sub


Sub Makro2()
Columns("E:E").Select
Selection.ClearFormats
Range("E1").Select
End Sub


Gruß Willie
Anzeige
AW: Bedingte Formatierung > 3
03.03.2004 17:42:28
Silvia
Herzlichen Dank. Nun funktioniert es soweit. Nur werden leider nachträgliche VBA-Änderungen bei den bisher eingetragenen Werten nicht berücksichtigt. Man sollte also die bedingte VBA-Formatierung nachträglich nicht ändern, oder sehe ich das falsch??
Silvia
AW: Bedingte Formatierung > 3
03.03.2004 17:47:01
Willie
Nein du mußt bei eintragung oder Änderung das Makro nochmal laufen lassen!
Gruß
Willie
AW: Bedingte Formatierung > 3
03.03.2004 18:01:48
Silvia
Ich habe leider keine Ahnung von VBA, daher meine Fragen.
Ich habe nun das Makro nach Emfpehlung von xXx hergenommen. Es hängt nun aber direkt an der Tabelle und ist nicht als Modul angelegt.
Ich wollte nun eine SChaltfläche erstellen, über die ich das Makro ausführen kann. Dieses Makro steht aber nicht zur Auswahl. Wie bekomme ich das her?
Außerdem würde mich interessieren, wie ich die Zellenformatierung noch auf Fett, kursiv, etc. verändern kann.
Herzlichen Dank!
Silvia
Das Makro sieht folgendermaßen aus:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'   HINTERGRUND
'   für Schrift RaZelle.Font.ColorIndex
Dim RaBereich As Range, RaZelle As Range
' Bereich der Wirksamkeit
Set RaBereich = Range("B3:D5000")
'    ActiveSheet.Unprotect ("Passwort")
For Each RaZelle In Range(Target.Address)
If Not Intersect(RaZelle, RaBereich) Is Nothing Then
Select Case UCase(RaZelle.Value) ' UMWANDLUNG DER Eingabe in Großbuchstaben
Case "SU"
RaZelle.Interior.ColorIndex = 0
' Standard
RaZelle.Font.ColorIndex = 7
' Schriftfarbe lila 6 = gelb
'RaZelle.NumberFormat = "General"
' Zellenformat Standard
Case "K"
RaZelle.Interior.ColorIndex = 0
' Standard
RaZelle.Font.ColorIndex = 3
' Schriftfarbe rot
'RaZelle.NumberFormat = ";;;"
' nicht sichtbar
Case "U"
RaZelle.Interior.ColorIndex = 0
' standard
RaZelle.Font.ColorIndex = 4
' Schriftfarbe gruen
'RaZelle.NumberFormat = "General"
' Zellenformat Standard
Case "FO"
RaZelle.Interior.ColorIndex = 0
' Standard
RaZelle.Font.ColorIndex = 5
' Schriftfarbe blau
'RaZelle.NumberFormat = "General"
' Zellenformat Standard
Case Else
RaZelle.Interior.ColorIndex = xlNone
' Keine
RaZelle.Font.ColorIndex = 0
' Schriftfarbe automatisch
'RaZelle.NumberFormat = "General"
' Zellenformat Standard
End Select
End If
Next RaZelle
'    ActiveSheet.protect ("Passwort")
Set RaBereich = Nothing
End Sub

Anzeige
AW: Bedingte Formatierung > 3
03.03.2004 18:04:13
Willie
Hallo Silvia
ich muss leider weg reicht es dir morgen Mittag?
Gruß
Willie
AW: Bedingte Formatierung > 3
03.03.2004 18:10:32
Silvia
Hi Willie! Ja. Vielen Dank und einen schönen Feierabend!
AW: Bedingte Formatierung > 3
03.03.2004 20:45:01
xXx
Hallo,
normalerweise sollte das Makro bei jeder Änderung (Change) im Blatt laufen.
Gruß aus'm Pott
Udo
http://www.excelerator.de
P.S.Das Forum lebt auch von den Rückmeldungen an die Antworter.

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige