ich habe in einer Spalte fünf unterschiedliche Werte zu stehen (a,b,c,d,e).
Nun würde ich mir gerne (mit Klick auf einen Button) in einer MsgBox anzeigen lassen wie oft die Werte vorhanden sind( z.B. 5xa, 3xb,....).
Kann Jemand helfen?
Gruß
Sub Anzahl()
MsgBox Application.CountIf(Columns(1), "a") & " * a" & vbLf _
& Application.CountIf(Columns(1), "b") & " * b" & vbLf _
& Application.CountIf(Columns(1), "c") & " * c" & vbLf _
& Application.CountIf(Columns(1), "d") & " * d" & vbLf _
& Application.CountIf(Columns(1), "e") & " * e" & vbLf
End Sub
Spalte bitte anpassen.