2012-06-05 35 views

回答

5

對我來說,你正在描述一個腳本字典。看看這是否令人滿意。

Dim dct As Object 
Set dct = CreateObject("Scripting.Dictionary") 
dct.Add "Key1", "Value1" 
dct.Add "Key2", "Value2" 
Debug.Print dct.Count 
Debug.Print dct("Key1") 
Debug.Print dct("Key2") 
Set dct = Nothing 
+0

確實有效,謝謝 – MyNameIsKhan

+0

您可以使用值列表而不是單個值嗎? –

+0

字典將接受項目值的數組,但不接受密鑰。 – HansUp