Anzeige
Archiv - Navigation
532to536
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
532to536
532to536
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

2 Farben zählen bedingte Formatierung

2 Farben zählen bedingte Formatierung
13.12.2004 21:23:01
Rene
Hallo
Ich möchte in einigen Spalten die Farben zählen (Azahl rote + Anzahl grüne Felder)pro Spalte
Die Farben stammen aus einer bedingten Formatierung (Formel)nicht Zellwert.
Habe mal einen Beitrag gefunden
Bei dieser Lösung wird aber nur die Bedingung der ersten bedingten
Formatierung erfüllt. (d.h Ist die erste bedingte Formatierung = rot werden nur die roten gezählt Bedingung 2 (grün) wird nicht beachtet.
Kann mir jemand weiterhelfen ?

3
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: 2 Farben zählen bedingte Formatierung
Ramses
Hallo
zeig doch mal den Code den du gefunden hast.
Gruss Rainer
AW: 2 Farben zählen bedingte Formatierung
14.12.2004 07:14:49
Rene
Hier der Code
Dim Formel As Integer
Dim Formel2 As Integer

Function BedZählen(Bereich As Range)
s = 0
gefunden = False
For Each c In Bereich.Cells
If c.FormatConditions.Count > 0 Then
gefunden = True
If c.FormatConditions(1).Type = xlCellValue Then
Formel = c.FormatConditions(1).Formula1
OP = c.FormatConditions(1).Operator
Select Case OP
Case 0
Case xlBetween
Formel2 = c.FormatConditions(1).Formula2
Bed = Formel <= c.Value And c.Value <= Formel2
Case xlEqual
Bed = c.Value = Formel
Case xlGreater
Bed = c.Value > Formel
Case xlGreaterEqual
Bed = c.Value >= Formel
Case xlLess
Bed = c.Value < Formel
Case xlLessEqual
Bed = c.Value <= Formel
Case xlNotBetween
Formel2 = c.FormatConditions(1).Formula2
Bed = Formel > c.Value Or c.Value > Formel2
Case xlNotEqual
Bed = c.Value <> Formel
End Select
If Bed Then
s = s + 1
End If
End If
Else
If gefunden = False Then
BedZählen = ""
End If
End If
Next
If gefunden = True Then
BedZählen = s
End If
End Function

Anzeige
AW: 2 Farben zählen bedingte Formatierung
14.12.2004 11:46:30
Rene
Hier der Code
Dim Formel As Integer
Dim Formel2 As Integer

Function BedZählen(Bereich As Range)
s = 0
gefunden = False
For Each c In Bereich.Cells
If c.FormatConditions.Count > 0 Then
gefunden = True
If c.FormatConditions(1).Type = xlCellValue Then
Formel = c.FormatConditions(1).Formula1
OP = c.FormatConditions(1).Operator
Select Case OP
Case 0
Case xlBetween
Formel2 = c.FormatConditions(1).Formula2
Bed = Formel <= c.Value And c.Value <= Formel2
Case xlEqual
Bed = c.Value = Formel
Case xlGreater
Bed = c.Value > Formel
Case xlGreaterEqual
Bed = c.Value >= Formel
Case xlLess
Bed = c.Value < Formel
Case xlLessEqual
Bed = c.Value <= Formel
Case xlNotBetween
Formel2 = c.FormatConditions(1).Formula2
Bed = Formel > c.Value Or c.Value > Formel2
Case xlNotEqual
Bed = c.Value <> Formel
End Select
If Bed Then
s = s + 1
End If
End If
Else
If gefunden = False Then
BedZählen = ""
End If
End If
Next
If gefunden = True Then
BedZählen = s
End If
End Function

Anzeige

310 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige