Hi Experts,
Could any of you help me out in my worksheet VBA Program.
I need to filter and copy a list with its occurences. But it has to be consolidated before that.
Please find my worksheet for a better understanding of the problem.
Many Thanks and Kind Regards,
Antz
This is my code
Private Sub CommandButton1_Click()
Dim myrng As Range, cl As Range
Set myrng = Range("A2", Range("A" & Rows.Count).End(xlUp))
With CreateObject("scripting.dictionary")
For Each cl In myrng
.Item(cl.Value) = .Item(cl.Value) + 1
Next cl
Range("J2:K100").ClearContents
Range("J2").Resize(.Count, 2) = Application.Transpose(Array(.keys, .Items))
End With
End Sub
Could any of you help me out in my worksheet VBA Program.
I need to filter and copy a list with its occurences. But it has to be consolidated before that.
Please find my worksheet for a better understanding of the problem.
Many Thanks and Kind Regards,
Antz
This is my code
Private Sub CommandButton1_Click()
Dim myrng As Range, cl As Range
Set myrng = Range("A2", Range("A" & Rows.Count).End(xlUp))
With CreateObject("scripting.dictionary")
For Each cl In myrng
.Item(cl.Value) = .Item(cl.Value) + 1
Next cl
Range("J2:K100").ClearContents
Range("J2").Resize(.Count, 2) = Application.Transpose(Array(.keys, .Items))
End With
End Sub
Last edited: