如何使用窗体把窗体中的信息提交到sheet中?
步骤:1. 判断数据是否为空;
2. 数据写入对应的表格;
3.关闭窗体。
'提交按钮
Private Sub CommandButton1_Click()
‘定义
Dim ret
ret = MsgBox("信息提交则不允许更改,是否确认提交", vbYesNo)
'确认提交
If ret = vbYes Then
'数据写入excel
Dim ws As Worksheet
Set ws = Sheets("sheet1")
' 判断数据是否为空
If ComboBox1.value = "" Or ComboBox2.value = "" Or ComboBox3.value = "" Or ComboBox4.value = "" _
Or TextBox1.value = "" Or TextBox2.value = "" Or TextBox3.v