AW: vba doppelte werte nur einmal zählen
07.01.2016 11:55:10
ransi
Hallo Gregor,
Willst du nur doppelte zählen oder auch 3-fache und 4-fache ?
Option Explicit
Sub machs()
Dim myDic As Object
Dim arr As Variant, out As Variant
Dim erste As Long, letzte As Long
Dim L As Long
erste = 1
letzte = 10000
Set myDic = CreateObject("scripting.Dictionary")
arr = Range("A" & erste & ":A" & letzte)
For L = LBound(arr) To UBound(arr)
If myDic.exists(arr(L, 1)) Then
myDic(arr(L, 1)) = arr(L, 1) & " Mehrfach"
Else:
myDic(arr(L, 1)) = "irgendwas"
End If
Next
out = Filter(myDic.items, " Mehrfach")
MsgBox UBound(out) + 1 & " Mehrfache"
End Sub
ransi