excel - 结束块 VBA 消息
问题描述
下面是我写的代码。我不明白为什么我不断收到错误消息“如果没有阻止则结束”....有什么建议吗?
Sub SaveTemplate()
Dim TempRow As Long, TempCol As Long
With Sheet1
If .Range("E3").Value = Empty Or .Range("G3").Value = Empty Or .Range("E5").Value = Empty Then MsgBox "Please contact us with questions"
Exit Sub
End If
If .Range("B3").Value = True Then 'New Template
TempRow = .Range("D999").End(xlUp).Row + 1 'First Avail Row
Else
TempRow = .Range("B4").Value
End If
For TempCol = 4 To 8
.Cells(TempRow, TempCol).Value = .Range(.Cells(15, TempCol).Value).Value 'Bring down values from form into table
Next TempCol
.Range(TempRow & "." & TempRow).WrapText = False
End With
End Sub
解决方案
在新行上写下:
MsgBox "Please contact us with questions"
它的编写方式,它不需要End If
.
推荐阅读
- php - 转义href
- vba - 循环中的 AVERAGEIFS
- android - 如何从片段的 recyclerview ViewHolder 类更新活动中的文本视图
- python-3.x - 使用 selenium 用随机数填写表格
- javascript - 如何从其子元素访问 iframe 元素
- python - Python在循环引用中使用Tkinter变量时如何避免手动内存管理?
- sql - 在不改变数据类型字符串的情况下计算hive中两列字符串类型的时间差
- javascript - 如何在 javascript 主文件中导入外部模块(async.js)
- python - 运行时 Python 程序的外部输入
- cmake - cmake 3.11.4 无法正常启动?