我想声明这样的事情:
dictionaryItem = {("Key1", "Value1"}, {"Key2", "Value2"} ... }
Run Code Online (Sandbox Code Playgroud)
但无法正确获得语法.如果不是,我想制作两个带有初始值的数组(但无论我怎么写它都无法使它工作).
在我看来,你正在描述一篇脚本词典.看看这是否令人满意.
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
Run Code Online (Sandbox Code Playgroud)