我正在使用以下代码从另一个工作表中插入数据到下拉列表中。当用户从另一个下拉列表中选择某个选项时,就会实现这一点。
lstRow = Sheets("Data Sheet").Range("D" & Rows.Count).End(xlUp).Row
Sheets("Data Insert").Range("C3").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="='Associated British Ports'!$G$7:$G" & lstRow
.IgnoreBlank = False
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = "Invalid Selection"
.InputMessage = ""
.ErrorMessage = _
"Please select a user from the list or select New User as the configuration type."
.ShowInput = True
.ShowError = True
End With
我想添加一个功能,当用户输入几个字母时,它会搜索列表并消除不包含该字母的任何内容。 例如,如果下拉菜单中有以下内容: A Thomas c Smith f Graham t Evans s davids B matthews
当用户输入"th"时,剩余的值应为:
A Thomas c Smith B matthews
即使用户必须以A Th...的形式输入名称才能返回A Thomas的简化版本也可以接受,如果上述操作不可行。
我看到了这个http://www.ozgrid.com/Excel/autocomplete-validation.htm和这个Excel data validation with suggestions/autocomplete 但我不确定如何将其与上述代码集成,或者是否可能!
请问有人可以帮我吗?
谢谢!