Vla*_*d M 4 excel vba dictionary
是否可以从字典中提取第 n 个键及其在 VBA 中的值?就像是
For i = 1 To Counter + diccompare.Count - UBound(RecSource)
WS.Cells(Lastrow + i, "A") = diccompare.Keys(UBound(RecSource) - Counter + i)
Next
Run Code Online (Sandbox Code Playgroud)
我尝试为 Cell(Lastrow +i) 分配字典 diccompare(UBound(RecSource) - Counter + i) 中键的值
不确定我是否完全理解你,就像这样
Sub KeyTest()
Dim d As New Scripting.Dictionary
d.Add "Test1", 1
d.Add "Test2", 2
d.Add "Test3", 99
Debug.Print d.Keys()(1)
End Sub
Run Code Online (Sandbox Code Playgroud)