Sub RemoveDuplicatesFromColumnN()
Dim LastRow As Long
Dim i As Long
LastRow = Cells(Rows.Count, "N").End(xlUp).Row ' N列の最終行を取得
' 重複を取り除いた値を一時的に格納するためのコレクションを作成
Dim uniqueValues As New Collection
Dim currentValue As String
' N列の値を走査して重複を取り除く
For i = 1 To LastRow
currentValue = Cells(i, "N").Value ' N列の値を取得
On Error Resume Next
uniqueValues.Add currentValue, CStr(currentValue) ' 重複しない値をコレクションに追加
On Error GoTo 0
Next i
' S列にユニークな値を出力
For i = 1 To uniqueValues.Count
Cells(i, "S").Value = uniqueValues(i)
Next i
End Sub