|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 企鹅先森 于 2019-11-4 16:00 编辑
If [j8] = "否" Then '当j8为指定值,l8不能为空'
If [l8] = "" Then
MsgBox "流失原因不能为空"
Else
大神帮忙看下 这段代码 当j8为其它值时 程序就没有反应了 不往下走了 要怎么改
只有为否时才需要提示 其它的值忽略
完整的后续代码是
Sub Record_Save()
Dim ShtName(1 To 6) As String, LookupValue As String
Dim i As Integer, iRow As Long, vbMSG As Long
Dim IDFlag As Boolean ' IDFlag :任何表中都没有历史记录,完全是新记录,则为 True,可以增加编号值
'温馨提示
With Sheets("信息录入")
If .Cells(2, 5) = "" Then MsgBox "【姓名】不能为空!请双击开始输入!", vbOKOnly, "温馨提示!": Exit Sub
If .Cells(2, 7) = "" Then MsgBox "【性别】不能为空!", vbOKOnly, "温馨提示!": Exit Sub
If .Cells(2, 9) = "" Then MsgBox "【年龄】不能为空!", vbOKOnly, "温馨提示!": Exit Sub
If .Cells(3, 3) = "" Then MsgBox "【所在学校】不能为空!请双击开始输入!", vbOKOnly, "温馨提示!": Exit Sub
If .Cells(3, 7) = "" Then MsgBox "【年级】不能为空!!", vbOKOnly, "温馨提示!": Exit Sub
If .Cells(3, 9) = "" Then MsgBox "【生日】不能为空!请双击开始输入!", vbOKOnly, "温馨提示!": Exit Sub
If .Cells(5, 7) = "" Then MsgBox "【状态】不能为空!", vbOKOnly, "温馨提示!": Exit Sub
If .Cells(8, 9) = "" Then MsgBox "【实际收费】不能为空!", vbOKOnly, "温馨提示!": Exit Sub
End With
If WorksheetFunction.CountA(Range("C6,F6,I6")) = 0 Then MsgBox "【电话至少要填一个】不能为空!请双击开始输入!", vbOKOnly, "温馨提示!": Exit Sub
If WorksheetFunction.CountA(Range("B8:L13")) = 0 Then MsgBox "警告!!!【科目信息为空】无法存储!!!", vbOKOnly, "温馨提示!": Exit Sub
If [j8] = "否" Then '当A1为指定值,A2不能为空'
If [l8] = "" Then
MsgBox "流失原因不能为空"
Else
'MsgBox "感谢您的配合!"
|
|