回答拝見致しました。
# 追記があるまで待ったほうがよいかもしれませんが。
多数のデータをシートに書き込むとかであれば、
配列にしておいて一括して書き込むことで処理速度の向上が見込めます。
ただ20行程度であれば、あえて配列にするメリットもないかと思います。
既にご指摘のとおりでしょう。
配列やdictionaryの学習用として、以下、下記します。
配列を使うとすれば、動的配列を、ひとつずつ大きさを拡大していくのが一般的です。
これに沿ったものが下記の test1です。
しかし、この場合は、上限が明確なので、最初に大きめの配列を作成しておき、
最後に使わなかった部分を縮小させたほうが簡便でしょう。
それが下記の test2です。
参考にして下さい。
Sub test1()
Dim lastRow As Long
Dim dic As Object
Dim mat() As String
Dim s As String
Dim firstFlag As Boolean
Dim k As Long
Set dic = CreateObject("Scripting.Dictionary")
lastRow = Cells(Rows.Count, "A").End(xlUp).row
firstFlag = True
For k = 1 To lastRow
s = Cells(k, "A")
If Not dic.exists(s) Then
dic(s) = Empty
Else
If firstFlag Then
ReDim mat(0)
mat(0) = Cells(k, "C")
firstFlag = False
Else
ReDim Preserve mat(UBound(mat) + 1)
mat(UBound(mat)) = Cells(k, "C")
End If
End If
Next
Stop '' 変数内容確認目的
End Sub
Sub test2()
Dim lastRow As Long
Dim dic As Object
Dim mat() As String
Dim s As String
Dim k As Long, j As Long
Set dic = CreateObject("Scripting.Dictionary")
lastRow = Cells(Rows.Count, "A").End(xlUp).row
ReDim mat(1 To lastRow)
For k = 1 To lastRow
s = Cells(k, "A").Value
If Not dic.exists(s) Then
dic(s) = Empty
Else
j = j + 1
mat(j) = Cells(k, "C")
End If
Next
ReDim Preserve mat(1 To j) '必要な分だけに縮める
Stop '' 変数内容確認目的
End Sub
なお、重複を除いて抽出するフィルタオプションが適当かもしれませんね。