Re: Excel Problem
25.09.2002 19:44:00
Hajo_Zi
Hallo Walterso ganz weiß ich nicht was Du zählen willst darum mal alles was ich habe
In Zelle=Farbsumme(A1:A10;3)
Function Farbsumme(Bereich As Range, Farbe As Integer)
' Schriftfarb
Dim Zelle
Application.Volatile
For Each Zelle In Bereich
If Zelle.Font.ColorIndex = Farbe Then
Farbsumme = Farbsumme + Zelle
End If
Next
End Function
Function FarbsummeH(Bereich As Range, Farbe As Integer)
' Hintergrund
Dim Zelle
Application.Volatile
For Each Zelle In Bereich
If Zelle.Interior.ColorIndex = Farbe Then
FarbsummeH = FarbsummeH + Zelle
End If
Next
End Function
Function Summe_Fett()
Application.Volatile
Dim I As Integer
For I = 5 To 36
If Cells(I, 1).Font.Bold = True Then
If Cells(I, 1) < Summe_Fett Then Summe_Fett = Cells(I, 1)
End If
Next
End Function
Function Farbsumme(Bereich As Range, Name As String, Farbe As Integer)
' Schriftfarbe nach Anzahl mit Suchbegriff
Dim Zelle
Dim I As Integer
Application.Volatile
For Each Zelle In Bereich
If Zelle.Font.ColorIndex = Farbe And Zelle = Name Then
I = I + 1
End If
Next
Farbsumme = Name & " " & I & " in Farbe " & Farbe
End Function
Anzahl der Zellen mit einer Farbe
' In Zelle=Farbsumme(A1:A10;3)
Function FarbsummeH(Bereich As Range, Farbe As Integer)
' Hintergrund
Dim Zelle
Application.Volatile
For Each Zelle In Bereich
If Zelle.Interior.ColorIndex = Farbe Then
FarbsummeH = FarbsummeH + 1
End If
Next
End Function
Gruß Hajo