Confirmation Pop-up

  • Thread starter Thread starter BannerBrat
  • Start date Start date
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?
 
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
 
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)
 
Insert this into your code?

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