Adding a Confirmation Step to Macro

S

saturnin02

Hi,
I got this Macro off of DmcRitchie's web site.
It removes all formulas from a workbook (pasting as values)
How can I ADD a CONFIRMATION STEP that will bring up dialog box saying
(something like):
"Are you sure you want to strip all formulas form this workbook?"
Yes and No Buttons
Let me know if easy to do.
Tx,
S

Sub Remove_All_Formulas_In_All_Sheets 'No_formula_Macro()
'Goodnight 2000-10-27 programming -- Striping a workbook of formulas
Dim SH As Worksheet
For Each SH In Worksheets
SH.Activate
Application.ScreenUpdating = False
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:= False, Transpose:=False
Next
End Sub
 
B

Bob Phillips

Sub Remove_All_Formulas_In_All_Sheets 'No_formula_Macro()
'Goodnight 2000-10-27 programming -- Striping a workbook of formulas
Dim SH As Worksheet
Dim ans As Long

ans = MsgBox("Are you sure you want to strip all formulas form this
workbook?", vbYesNo)
If ans =, vbYes Then
For Each SH In Worksheets
SH.Activate
Application.ScreenUpdating = False
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:= False, Transpose:=False
Next
End If
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top