Need a popup "are you sure" query to run from a button to prevent accidental use


Posted by Skewer on July 16, 2001 4:21 PM

Hiya all
I have a button that clears last week's data (the
context of this isn't important) in a simple spreadsheet
but if you hit it, ctrl+z doesn't undo. The macro it
runs just clears various ranges from sheets mon-sun,
ready for a fresh week's entries, but if anyone can
suggest a macro or hint for this I'd appreciate it.

If this was an onClick thing on a website it would be so
less daunting... :)

Posted by Skewer on July 16, 2001 6:13 PM

Got the MsgBox but need "No" selected by default (must be simple)

Please help with a one-liner that will automatically
set "no" as the best option from yes/no on a MsgBox,
as a wandering cat could still delete stuff by accident!

Thanks

Posted by Ivan F Moala on July 16, 2001 6:50 PM

Re: Got the MsgBox but need "No" selected by default (must be simple)

Q = MsgBox("are you sure ?", vbYesNo + vbDefaultButton2, "Continue")

Key is the VbDefaultButton2 = No on a VbYesNo button


Ivan



Posted by Skewer on July 17, 2001 11:13 AM

Thanks! (no mesage, don't click)

.