所以我有一个用户表单,其中comboBox用作动态搜索框.
需要搜索的数据位于另一个工作簿(1200多行)中.为了避免不断打开和关闭该数据工作簿,我在表单初始化期间将其全部加载到字典中.
现在我的问题是:是否可以快速过滤字典数据(和更新组合框),因为用户正在打字或我是否需要更改我的方法?
任何帮助将不胜感激.
这是我到目前为止的代码:
Option Explicit
Private emplDict As Object
'all other constants and functions are declared in a separate module named "code"
Private Sub btnClose_Click()
Unload Me
End Sub
Private Sub comboSearch_Change()
Me.comboSearch.DropDown
End Sub
Private Sub UserForm_Initialize()
Dim xlWS As Worksheet
Dim xlWB As Workbook
Dim rng As Range
Dim lstRw As Long
Dim item As Variant
Application.Run "code.xlHelper", False ' turn off screen updating, alerts, events
Set emplDict = CreateObject("scripting.dictionary")
Set xlWB = Workbooks.Open(Filename:=SUB_PLANNING & EMPLOYEE_LIST) …Run Code Online (Sandbox Code Playgroud)