Is there a way to do the following:?
有没有办法做到以下几点:?
I would like a manual text box that when filled in and the user clicks "Add" and it adds the value to the combo box. However, I will also have this list stored somewhere so that the next time the user loads the form they can select "Previously Used" items from a list and these will then also be added to the combo box.
我想要一个手动文本框,当填写并且用户单击“添加”并将值添加到组合框时。但是,我也会将此列表存储在某处,以便下次用户加载表单时,可以从列表中选择“以前使用”的项目,然后这些项目也会添加到组合框中。
I will be adding a button to "Add all" of the previous items but it must still have the option to add items manually each time.
我将添加一个按钮以“添加所有”之前的项目,但它仍然必须选择每次手动添加项目。
Even more useful would be to have an option to check items in and out of the combo box as well as the manually text input option.
更有用的是可以选择检查组合框中的项目以及手动文本输入选项。
I tried to add an image I found to better explain this but I need 10 rep points. Therefore, I hope this makes sense but please feel free to comment for more details and a better explanation if needed.
我试图添加一个我发现的图像来更好地解释这个,但我需要10个重复点。因此,我希望这是有道理的,但如果需要,请随时评论更多细节和更好的解释。
Link to an example of what I am thinking of but without the manual addition field:
链接到我正在考虑但没有手动添加字段的示例:
1 个解决方案
#1
0
Use this
combobox1.additem txtValue.Text
Sheets("SheetName").Cells(lastRow+1,col).value=txtValue.Text
Also add below code in Form_activate
还要在Form_activate中添加以下代码
For i=1 to lastrow
combobox1.additem Sheets("SheetName").Cells(i,col).value
next i
#1
0
Use this
combobox1.additem txtValue.Text
Sheets("SheetName").Cells(lastRow+1,col).value=txtValue.Text
Also add below code in Form_activate
还要在Form_activate中添加以下代码
For i=1 to lastrow
combobox1.additem Sheets("SheetName").Cells(i,col).value
next i