0
鍵值我已經用該方法的數據列表識別出的唯一值我有以下縮寫:拉從VBA字典
Dim dictionary as scripting.dictionary
Dim data() as String
Dim dataSize as Integer
Dim j as integer
Dim v as variant
DataSize = myRange.Rows.Count
Redim data(dataSize)
For j = 1 to UBound(data)
data(j) = myRange.Cells(j,1).Value
dictionary(data(j)) = 1
Next j
這應該是存儲從myRange唯一值的鍵值。但是,我似乎無法弄清楚如何訪問這些值。我曾嘗試以下:
For each v in dictionary.Keys()
myVar = v
'dostuff to myVar
next v
和
For each v in dictionary.Keys()
myVar = dictionary.Keys(v)
'dostuff to myVar
next v
但既不工程。我錯過了什麼?
的'myVar的= v'方法會奏效。 – YowE3K
它沒有爲我工作。我發佈了下面的工作。 – GSF
缺少縮進,一件事。 –