how do you make a certain MsgBox always say yes or no.
example when it asks to save it always says yes automaticly.
how do you make a certain MsgBox always say yes or no.
example when it asks to save it always says yes automaticly.
Tim,
See VBA Help on Msgbox. All you need is there & then some...
Example:
Mgsbox "Today is Friday ?", VbYesNo + vbDefaultButton2
will default to No
Mgsbox "Today is Friday ?", VbYesNo + vbDefaultButton1
Will Default to Yes
Jeff
"tim64" wrote:
>
> how do you make a certain MsgBox always say yes or no.
> example when it asks to save it always says yes automaticly.
>
>
> --
> tim64
> ------------------------------------------------------------------------
> tim64's Profile: http://www.excelforum.com/member.php...o&userid=23295
> View this thread: http://www.excelforum.com/showthread...hreadid=376894
>
>
Try using something like:
resp = MsgBox("Yes or No?", vbYesNo + vbDefaultButton2)
The vbYesNo gives you a 'Yes' and a 'No' button, vbDefaultButton2
defaults the 'No' button. If you omit the vbDefaultButton, 'Yes' is
defaulted.
HTH,
Jon C
What's the point of asking?
Perhaps this is what you want:
MsgBox "Going to save now", vbOKOnly
Or did you mean set the default button - see the vba help on msgbox - this
is pretty explanatory.
--
Regards,
Tom Ogilvy
"tim64" <[email protected]> wrote in
message news:[email protected]...
>
> how do you make a certain MsgBox always say yes or no.
> example when it asks to save it always says yes automaticly.
>
>
> --
> tim64
> ------------------------------------------------------------------------
> tim64's Profile:
http://www.excelforum.com/member.php...o&userid=23295
> View this thread: http://www.excelforum.com/showthread...hreadid=376894
>
tim64 shared this with us in microsoft.public.excel.programming:
>
> how do you make a certain MsgBox always say yes or no.
> example when it asks to save it always says yes automaticly.
Beware: tim64 is clueless about newsgroups. He uses a web forum that
propagates to usenet
(http://www.excelforum.com/search.php?searchid=131065). IMHO, these web
forum users don't get enough information on how the newsgroups work.
They are a nuisance and it's not even their own fault. And I'm not
talking about the MS web forum, but about all those little third-party
freeloader websites. :-(
--
Amedee Van Gasse using XanaNews 1.17.4.1
Or you are probably looking at something like
Application.DisplayAlerts = False
' your code here
Application.DisplayAlerts = True
So you won't get any message box asking for save - yes no
Mangesh
how do you make a certain MsgBox always say yes or no.
example when it asks to save it always says yes automaticly.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks