私が達成しようとしているのは、列内の一意の値(文字列)のリストを返すことです。そのリストを配列に入れ、値のリストを新しいシート、たとえば列Aに貼り付けます。次に、各配列要素について、元のリストが発生した回数をカウントし、新しいシートの列Bにその頻度のカウントを返します。そのユニークな文字列。
これはこれまでの私のコードです。
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