Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
620to624
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
620to624
620to624
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

Makro - Bedingte Formatierung

Makro - Bedingte Formatierung
09.06.2005 10:14:45
Thomas
Hallo zusammen!
Ich habe folgendes Problem:
Ich habe eine Liste mit folgenden Total-Zeilen:
"Total DG"
"Total VU"
"Total Service"
"Total Kundenschulung"
"Total Kundenversuch" und
"Total Engineering"
Die Zeilen Total DG und Total VU sollten einen blauen Hintergrund bekommen und fett werden (Mit einem Makro (analog der bedingten Formatierung) habe ich dies geschafft). à Schaue unten....
Nun möcht ich, dass alle Total-Zeilen, welche von Total DG und Total VU abweichen, eine orange Hintergrundfarbe bekommen.
Wie schreibe ich dies im Makro?
Danke im Voraus!!!

Sub Makro14()
Columns("A:F").Select
Selection.FormatConditions.Delete
'1. Bedingung
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=$A1=""Total DG"""
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
End With
Selection.FormatConditions(1).Interior.ColorIndex = 37
'2. Bedingung
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=$A1=""Total VU"""
With Selection.FormatConditions(2).Font
.Bold = True
.Italic = False
End With
Selection.FormatConditions(2).Interior.ColorIndex = 37
'3. Bedingung
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=$A1=""Total Service"""
With Selection.FormatConditions(3).Font
.Bold = True
.Italic = False
End With
Selection.FormatConditions(3).Interior.ColorIndex = 45
'4. Bedingung
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=$A1=""Total Kundenversuch"""
With Selection.FormatConditions(4).Font
.Bold = True
.Italic = False
End With
Selection.FormatConditions(4).Interior.ColorIndex = 45
'5. Bedingung
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=$A1=""Total Kundenschulungen"""
With Selection.FormatConditions(5).Font
.Bold = True
.Italic = False
End With
Selection.FormatConditions(5).Interior.ColorIndex = 45
'6. Bedingung
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=$A1=""Total Engineering"""
With Selection.FormatConditions(6).Font
.Bold = True
.Italic = False
End With
Selection.FormatConditions(3).Interior.ColorIndex = 45
Range("A1").Select
End Sub

2
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Makro - Bedingte Formatierung
09.06.2005 12:42:40
Waltraud
Ich würde das Einfach über die Bedingte Formatierung, ohne Makro lösen.

Markiere den gesamten Bereich, wähle in der Symbolleiste Format "bedingte Formatierung"
2. Ändere "Zellwert ist" in "Formel ist"
3. als Text für die Formel gibst du ein =ODER($A1 = "Total DG";$A1 = "Total VU")
4. Wähle ein Format
5. Füge eine weitere Bedingung hinzu
6. Ändere "Zellwert ist" in "Formel ist"
7. als Text für die Formel gibst du ein =LINKS($A1;5) = "Total"
8. Wähle ein Format
AW: Makro - Bedingte Formatierung
09.06.2005 16:24:14
Thomas
Danke für deinen Tipp!
Habe nun die Lösung gefunden und das Makro läuft wunderbar!
Gruss,
thomas
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige