English 中文(简体)
使用 Excel 中的 VBA 使用索引# 选择词典词典条目
原标题:Selecting Item of Dictionary by Index # using VBA in Excel

我试图在字典中加载最后一个条目的组合框。 我正在尝试做类似 < code> ComboBox1. Value = nodeColll.Tropt( NodeCol. Count) 的东西, 这将与收藏一起工作, 但使用字典时会做一些奇怪的事情 。

最佳回答

行为是不同的, 因为字典允许数字键 。

调用 . tempt 实际上 adds 一个带有给定密钥的项目 ;

NodeColl.Item(NodeColl.Count)

添加一个没有值 & amp; 与计数相对应的密钥的新项目。

访问 ordinal 项使用 < code> 。 items (这是一个项目阵列)

firstItem = NodeColl.Items(0)
lastItem  = NodeColl.Items(NodeColl.Count - 1)
问题回答

暂无回答




相关问题
Handling no results for docmd.applyfilter

I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...

Outlook 2007 CommandBarControl.Execute won t work

I recently switched to Outlook 2007 and noticed that my VBA-macros won t work. I use the following code to open a new appointment-item (and fill it automatically). It worked perfect in Outlook 2003, ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

MS Access: list macro from VBA

I have to deal with a few macros (not VBA) in an inherited Access application. In order to document them, I would like to print or list the actions in those macros, but I am very dissatisfied by ...

热门标签