组合框清晰 [英] Combo Box clear
问题描述
我输入表格之前有一个包含32个组合框名称cb1到cb32的表格我需要在下一个条目之前重置表格
I have a form with 32 combo boxes names cb1 to cb32 after entering the form I need to reset the form prior to the next entry
我尝试了很多变种但是继续收到错误438
i have tried many variants but keep getting error 438
Dim c_d As Integer
Dim x_dc As Integer
对于c_d = 1到32步骤1
  x_dc =" cb" &安培; c_d
  MsgBox(x_dc)
  exp_ip.Controls(c_d).ClearContents
next。
我试过清楚,text =" ;",value ="",列表范围等等
i have tried clear, text="",value="",list range , and many more
任何想法
感谢阅读
推荐答案
Lux Sparks,
Lux Sparks,
当你说形式时,你的意思并不完全清楚。 我假设你的意思是用户形式。
when you say form, it isn't totally clear what you mean. I will assume you mean a userform.
所以我创建了一个名为Userform1的用户窗体,并在其上放置了两个activeX组合框(名为CB1和CB2)。 然后我使用以下代码输入一个命令按钮:
So I created a userform named Userform1 and put two activeX comboboxes on it (named CB1 and CB2). I then put on a command button with this code:
Private Sub CommandButton1_Click()
对于i = 1到2¥b $ b  ; UserForm1.Controls(" CB" i).ListIndex = -1
下一个
结束子
Private Sub CommandButton1_Click()
For i = 1 To 2
UserForm1.Controls("CB" & i).ListIndex = -1
Next
End Sub
我展示了userform,在组合框中进行选择,然后单击命令按钮并清除选择。
I show the userform, make selections in the comboboxes and then click the command button and the selections are cleared.
这是否符合您的要求?
Does that fit what you are trying to do?
这篇关于组合框清晰的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!