Anzeige
Archiv - Navigation
1080to1084
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
Inhaltsverzeichnis

Pivot und bedingte formatierung

Pivot und bedingte formatierung
19.06.2009 13:00:21
Julia
Hallo Experten,
in meiner Pivottabelle (PivotTable1) im Excel-Sheet "Fälligkeit" gibt es eine Spalte "Fälligkeit in Tagen" (ab Spalte A14 abwärts).
Dort stehen Zahlen drin.
Ist die Zahl Ist die Zahl zwischen 1 und 14 dann soll die Zelle gelb markiert werden / Schrift weiss, fett und zentriert
Ist die Zahl >= 14 dann soll sie grün sein / Schrift weiss, fett und zentriert
Ansonsten keine Formatierung / Schrift schwarz
Über die Bedingte Formatierung hab ich das hinbekommen.
Doch wenn sich meine Pivotabelle vergrößert verliert sich manchmal die Bedingte Formatierung
Kann man das über ein Makro lösen egal wie groß die Pivot wird?

4
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Pivot und bedingte formatierung
19.06.2009 15:29:53
Julia
Klappt genial
Habs angepasst auf meine Verhältnisse aber irgendwie will er nicht ganz
Meine Pivot beginnnt bei Zelle A14
Also die Zahlen stehen in A14 abwärts
Habe dann deinen Code so geändert...
Die Zelle A14 macht er mir korrekt doch danach kommt fehler
An dieser Stelle:
Range(Cells(14, 1), Cells(LetzteZeile, 1)).Select
Der kompeltte Code sieht so aus:

Sub BedForm()
LetzteZeile = [G65536].End(xlUp).Row - 2
Columns("A:A").Select
Selection.FormatConditions.Delete
Range("A14").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLessEqual _
, Formula1:="0"
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
.ColorIndex = 2
End With
Selection.FormatConditions(1).Interior.ColorIndex = 3
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:="1", Formula2:="14"
With Selection.FormatConditions(2).Font
.Bold = True
.Italic = False
.ColorIndex = 2
End With
Selection.FormatConditions(2).Interior.ColorIndex = 6
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="14"
With Selection.FormatConditions(3).Font
.Bold = True
.Italic = False
.ColorIndex = 2
End With
Selection.FormatConditions(3).Interior.ColorIndex = 4
Range("A14").Select
Selection.Copy
Range(Cells(14, 1), Cells(LetzteZeile, 1)).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("I12").Select
Range("G3").Select
End Sub


Anzeige
AW: Pivot und bedingte formatierung
19.06.2009 15:30:23
Julia
Klappt genial
Habs angepasst auf meine Verhältnisse aber irgendwie will er nicht ganz
Meine Pivot beginnnt bei Zelle A14
Also die Zahlen stehen in A14 abwärts
Habe dann deinen Code so geändert...
Die Zelle A14 macht er mir korrekt doch danach kommt fehler
An dieser Stelle:
Range(Cells(14, 1), Cells(LetzteZeile, 1)).Select
Der kompeltte Code sieht so aus:

Sub BedForm()
LetzteZeile = [G65536].End(xlUp).Row - 2
Columns("A:A").Select
Selection.FormatConditions.Delete
Range("A14").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLessEqual _
, Formula1:="0"
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
.ColorIndex = 2
End With
Selection.FormatConditions(1).Interior.ColorIndex = 3
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:="1", Formula2:="14"
With Selection.FormatConditions(2).Font
.Bold = True
.Italic = False
.ColorIndex = 2
End With
Selection.FormatConditions(2).Interior.ColorIndex = 6
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="14"
With Selection.FormatConditions(3).Font
.Bold = True
.Italic = False
.ColorIndex = 2
End With
Selection.FormatConditions(3).Interior.ColorIndex = 4
Range("A14").Select
Selection.Copy
Range(Cells(14, 1), Cells(LetzteZeile, 1)).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("I12").Select
Range("G3").Select
End Sub


Anzeige
AW: Pivot und bedingte formatierung
19.06.2009 17:08:23
robert
hi,
schau mal, in welcher spalte du die letzteZeile ermittelst.. G
LetzteZeile = [G65536].End(xlUp).Row - 2
daher G durch A ersetzten
gruß
robert

304 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige