AW: Spalte mit Namen auswerten
Boris
Hi Marion,
entweder Recorder anschmeissen, Spezialfilter - ohne Duplikate - an andere Stelle kopieren und dann ZÄHLENWENN anwenden - oder auch alles über ne Array-Variable - so in der Art (bezieht sich jetzt auf Spalte A):
Option Explicit
Sub alle_Namen()
Dim Bereich As Range, C As Range, lngCount As Long, myArray() As Variant, x As Long
Dim firstAddress As String
Set Bereich = Range("A1:A" & Range("A65536").End(xlUp).Row)
Set C = Bereich.Find("*")
If Not C Is Nothing Then
firstAddress = C.Address
Do
If Application.WorksheetFunction.Match(C, Bereich, 0) = C.Row Then
lngCount = lngCount + 1
ReDim Preserve myArray(1 To 2, 1 To lngCount)
myArray(1, lngCount) = C
myArray(2, lngCount) = WorksheetFunction.CountIf(Bereich, C)
End If
Set C = Bereich.FindNext(C)
Loop While Not C Is Nothing And C.Address <> firstAddress
End If
For x = 1 To lngCount
MsgBox "Name: " & myArray(1, x) & Chr(10) _
& "Anzahl: " & myArray(2, x), , "Gebe bekannt"
Next x
End Sub
Grüße Boris