excel - 如何将项目添加到列表框
问题描述
我在多个文本框中的用户窗体上有一组数据。
我编写了一个代码来查找是否有一个空白文本框会导致数据表不完整。
如果数据不完整,我希望它获取我的批号(在 中Txtbox10A10
)并将批号放在我的列表框中,以便我以后可以访问它以完成数据。
有什么办法可以做到这一点吗?我尝试了多种方法,但有很多错误。
解决方案
嗨对不起vba还是新手
我有以下一组代码
enter code here
Dim i As Integer
Dim J As Integer
Dim uppercolJ As Integer
Dim Mistakes As Integer
Dim x As Integer
' cmas = UserForm3.MultiPage1.Pages(UserForm3.MultiPage1.Value).Controls("Txtbox" & 1 & "A" & J)
Set Form = UserForm3.MultiPage1.Pages(UserForm3.MultiPage1.Value)
uppercolJ = 41
Mistakes = 0
For J = 28 To uppercolJ
ActiveTextBoxName = "Txtbox" & 1 & "A" & J
If UserForm3.MultiPage1.Pages(3).Controls(ActiveTextBoxName) = "" Then
Mistakes = Mistakes + 1
Else
End If
Next J
If Mistakes > 0 Then
MsgBox "Cells are incomplete, saving for later completion"
Else
MsgBox "comp"
'Call save
End If
End Sub`````
now when Mistakes > 0
then i would like it to save the batch no. of the product which can be found in Txtbox10A10
to a listbox i have created. so that if i come back tomorroww to finish all my data i can call that information from the batch no. in my listbox,
i have all coding already done just not sure how to get it to add my backnumber to the listbox upon Mistakes > 0
推荐阅读
- javascript - d3 嵌套数据模型的更新模式
- javascript - 不推荐使用 rowRange.setBackgroundColor
- r - 应用返回不同尺寸的不同答案,R
- javascript - ajax没有发回PHP响应
- vmware - VMWare - 多个 VM 与一个特定 VM(不是 ESX)的同步时间
- python-3.x - 将整数转换为日期
- api-design - 如何在 API 网关中复合多个 API 调用?
- java - 在android studio中获取带有JSON的数组列表
- r - 我想替换 R 中数据集中年份列的“NA”值
- ios - 在 swift4 中未调用 DatabaseReference.observe