【发布时间】:2020-02-27 14:38:28
【问题描述】:
我想运行我的 msgBox 即,单击“是”后,我想删除两件事。
我在这里找到了一些解决方案:
并尝试做一些有效的事情。 我的代码如下所示:
Case "Remove"
MsgBox "Do you want to remove all firestopping elements with their values?",
vbQuestion + vbYesNo
If MsgBox(Question) = vbYes Then
Sheets("hilti firestopping stores").Range("E5:E17").ClearContents
Call ActiveShapes
End If
...
Sub Firestopshapes()
Dim shp As Shape
Dim Ws As Worksheet
Set Ws = ActiveSheet
For Each shp In Ws.Shapes
If shp.Name = "Firestop" Then
shp.Delete
End If
Next shp
End Sub
结果如下图:
我还将If MsgBox(Question) = vbYes Then 与If ans = vbYes Then 互换了,但我得到了一个错误。
有什么方法可以让这个 msgbox 运行吗?
【问题讨论】: