I want to run my msgBox in action Namely, I would like to remove 2 things after clicking "Yes".
I found some solutions here:
and tried to do something working. My code looks like this:
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
The result is shown below:
I also interchanged the
If MsgBox(Question) = vbYes Then
with If ans = vbYes Then
but I am getting an error instead.
Is it some way to make this msgbox running?