Dictionaryを利用する
Dictionaryオブジェクトを利用します。
このページの中ではもっとも短時間で処理できます。
コード例
Sub myDic()
Dim myDic As Object, myKey As Variant
Dim c As Variant, varData As Variant
Set myDic = CreateObject(“Scripting.Dictionary”)
With Worksheets(“Sheet1″)
varData = .Range(“A1″, .Range(“A” & Rows.Count).End(xlUp)).Value
End With
For Each c In varData
If Not c = Empty Then
If Not myDic.Exists(c) Then
myDic.Add c, Null
End If
End If
Next
myKey = myDic.Keys
With Worksheets(“Sheet2″)
.Range(“G:G”).ClearContents
.Range(“G1″).Resize(myDic.Count) = Application.WorksheetFunction.Transpose(myKey)
End With
Set myDic = Nothing
End Sub
>文書作成代行/データ入力代行サービス
>ワード・エクセル・マクロVBA・パワーポイント・アクセス企業パソコン研修
>出張パソコン教室ITスクール
>パソコンの家庭教師BEST