HSV
Inventaris
- Lid geworden
- 18 jul 2008
- Berichten
- 20.981
- Office versie
- Bèta Insider Office 365
Je wilt alleen de namen die er dubbel in staan zien?
Code:
Sub hsv()
Dim oDic As Object, sn, i As Long, ii As Long, j As Long
Set oDic = CreateObject("scripting.dictionary")
For i = 1 To Sheets.Count - 1
sn = Sheets(i).Range("a3:a17").SpecialCells(2)
For ii = 1 To UBound(sn)
oDic.Item(sn(ii, 1)) = oDic.Item(sn(ii, 1)) + 1
Next ii
Next i
[COLOR=#FF0000] For j = oDic.Count - 1 To 0 Step -1
If oDic.Item(oDic.keys()(j)) = 1 Then oDic.Remove oDic.keys()(j)
Next j[/COLOR]
With Blad4
.Cells(2, 1).Resize(oDic.Count, 2) = Application.Transpose(Array(oDic.keys, oDic.items))
.Cells(1).CurrentRegion.Sort .[a1], , , , , , , 1
End With
End Sub
Bijlagen
Laatst bewerkt: