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 08:48:32
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).
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!!!

9
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Makro - Bedingte Formatierung
09.06.2005 09:27:17
marcl
Hallo Thomas,
Du hast genommen If ... = ... Then ?
dann könntest Du nehmen If ... ... Then
Gruß
marcl
AW: Makro - Bedingte Formatierung
09.06.2005 09:30:01
Thomas
Hallo Marcel
Schau mal, mein Makro sieht so aus....
Wie müsste ich nun das If ... ... Then einfügen?
Danke!

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

Anzeige
AW: Makro - Bedingte Formatierung
09.06.2005 10:29:15
ede
hallo thomas
versuchs mal damit
Columns("A:F").Select
Selection.FormatConditions.Delete
'1. Bedingung
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=ODER($A1=""Total DG"";$A1=""Total VU"")"
Selection.FormatConditions(1).Interior.ColorIndex = 32
'2. Bedingung
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=UND(ODER($A1""Total DG"";$A1""Total VU"";);TEIL($A1;1;5)=""Total"")"
Selection.FormatConditions(2).Interior.ColorIndex = 45
viel erfolg
AW: Makro - Bedingte Formatierung
09.06.2005 10:39:13
Thomas
Hallo Ede!
Vielen Dank! Dieses Makro ist ja der Hammer!
Es funktionert!!!!
Jetzt ist nur noch ein kleiner Schönheitsfehler...
Und zwar folgender: Zwischen dem Total VU und dem Total Service ist eine Leerzeile, die auch orange wird... Diese sollte aber normal (ohne Farbe) bleiben! Kannst du das auch lösen? Wäre seeeeehr nett!!
Vielen Dank!
Anzeige
AW: Makro - Bedingte Formatierung
09.06.2005 10:46:53
ede
habe es nochmal geprüft, bei mir bleibt die Zeile unformatiert, wenn in der Spalte A der Zeile nichts steht. wahrscheinlich kommt die Formatierung dann nicht aus der bebingten Formatierung.
AW: Makro - Bedingte Formatierung
09.06.2005 10:52:48
Thomas
Du sagst es! Nun funktionierts auch!
Kann man auch noch einen Code einfügen, damit diese Total Zeilen FETT werden?
Und am Ende der Liste, sollte nach einer Zeile Abstand folgende Zeile eingefügt werden:
Total x (x=Name des Tabellenblattes) und in den Spalten E und F die Summen der orang eingefärbten Zahlen.... Meinst du, das geht?
Wäre total kuul!!!!
Danke!
AW: Makro - Bedingte Formatierung
09.06.2005 11:05:08
ede
zur frage 1 hier der code erweitert:
Columns("A:F").Select
Selection.FormatConditions.Delete
'Selection.Interior.ColorIndex = xlNone
'1. Bedingung
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=ODER($A1=""Total DG"";$A1=""Total VU"")"
Selection.FormatConditions(1).Interior.ColorIndex = 32
With Selection.FormatConditions(1).Font
.Bold = True
End With

'2. Bedingung
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=UND(ODER($A1""Total DG"";$A1""Total VU"";);TEIL($A1;1;5)=""Total"")"
Selection.FormatConditions(2).Interior.ColorIndex = 45
With Selection.FormatConditions(2).Font
.Bold = True
End With
zur Frage 2:
dies würde ich über die Funktion SUMMEWENN() abhanden, also ohne vba-code.
viel erfolg
Anzeige
AW: Makro - Bedingte Formatierung
09.06.2005 11:10:20
Thomas
Ok! Vielen Dank! Du warst mir eine grosse Hilfe!!!
Gruss,
thomas
AW: Makro - Bedingte Formatierung
09.06.2005 10:27:04
Thomas
Kannst du mir nicht weiterhelfen?
Ist ziemlich dringend....
Gibt es eine einfache Lösung?
Danke und Gruss

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige