Confirmation Pop-up

B

BannerBrat

I've created a macro that will erase everything in a pre-selected area.
What I would like to add to it is a Pop-up asking for confirmation
incase the button was pressed by accident.
Can this be done? How?
 
F

Frank Kabel

Hi
try somethin like

sub foo()
Dim answer
.....
answer = Msgbox (Continue?,VbOKCancel)
If answer = vbCancel then
'do nothing
else
'your code here
end if
....
end sub

Frank
 
B

Bob Phillips

Here is one way

If MsgBox("Ok to continue?", vbYesNo) = vbYes Then
'continue
Else
Exit Sub
End If

--

HTH

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

JE McGimpsey

Insert this into your code?

If MsgBox("Really truly?", vbYesNo, "Confirm") = vbNo Then _
Exit Sub
 
Top