What I am trying to achieve is to return a list of the unique values(Strings) in a column. Put that list into an array and then paste the list of values into a new sheet say column A. Then for each array element count how many times it occured the original list and return the count of its frequency in column B in the new sheet against its unique string.
This is my code so far.
Sub UniqueList()
Dim rListPaste As Range
Dim causeList As Range
Dim iReply As Integer
Dim element As Variant
On Error Resume Next
Set rListPaste = Application.InputBox _
(Prompt:="Please select the destination cell", Type:=8)
If rListPaste Is Nothing Then
iReply = MsgBox("No range nominated," _
& " terminate", vbYesNo + vbQuestion)
If iReply = vbYes Then Exit Sub
End If
causeList = Range("E1", Range("E65536").End(xlUp))
Range("causeList").AdvancedFilter Action:=xlFilterCopy, Unique:=True
Range("causeList").AdvancedFilter CopyToRange:=causeList.Cells(1, 1)
element = 0
For Each element In causeList
element = element + 1
Next element
End
End Sub
For Each Temprangevariable in UniqueRangeon the resultant range from the CopyToRange - you can then setTemprangevariable.Offset(0,1)to the countif value.