Here's an example of how I do it. We start at the end of my current macro, go to Pauser, create two buttons to activate two other macros (choice for the user). After they choose, KillButts kills the buttons, then off to the next macro ("Resumer1"):
PT.ManualUpdate = False
Application.ScreenUpdating = True
'Turn off anything after our MFR month
MsgBox "Please deselect any months following your MFR month in the MOS2 tab"
Pauser
End With
Sub Pauser()
Application.ScreenUpdating = False
'1 is the first button, 2 is the second
For j = 1 To 2
'Where do we want the buttons, what macros should they run, and what should they say?
With ActiveSheet.Buttons.Add(Choose(j, 200, 325), 40, 81, 50)
.OnAction = Choose(j, "ResumeAuto", "KillButts")
.Characters.Text = "Click here to " & Choose(j, "Resume", "Cancel") & " the Automation"
'Color all of the font blue
With .Characters(1, 36).Font
.Name = "Verdana"
.Size = 9
.Color = vbBlue
End With
'Color "Resume" and/or "Cancel" in red
With .Characters(15, 6).Font
.FontStyle = "Bold"
.Color = vbRed
End With
End With
Next
'at this point, the automation stops until user hits "Resume", whereupon "ResumeAuto" runs.
Application.ScreenUpdating = True
End Sub
Sub ResumeAuto()
Killbutts
Resumer1
End Sub
Sub Killbutts()
'Activate sheet to delete autoshapes.
Dim GetShape As Shape
For Each GetShape In ActiveSheet.Shapes
GetShape.Delete
Next
End Sub
Bookmarks