Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,311
Default Can I customize the Yes/No buttons on a MsgBox?

Can I customize the MsgBox vbYesNo buttons to saw whatever I want? Example:
Instead of the buttons saying "Yes" and "No", am I able to make them say
"One" and "Two"?

n = MsgBox("test", vbYesNo)

Thanks in advance.
Paul


--



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Can I customize the Yes/No buttons on a MsgBox?

No; however, you can create your own "message box" using a UserForm with a
Label and two CommandButtons on it. Another possibility is to use the
standard MessageBox and customize your question so that Yes/No makes sense
as an answer. For example, your message could read something like this...

You are about to select either "One" or "Two". Would you like to select
"One"?

Personally, I would create my own "message box" using the UserForm.

--
Rick (MVP - Excel)


"PCLIVE" wrote in message
...
Can I customize the MsgBox vbYesNo buttons to saw whatever I want?
Example: Instead of the buttons saying "Yes" and "No", am I able to make
them say "One" and "Two"?

n = MsgBox("test", vbYesNo)

Thanks in advance.
Paul


--




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 449
Default Can I customize the Yes/No buttons on a MsgBox?

Rick

Just for fun: http://tinyurl.com/avqk9k

Best wishes Harald

"Rick Rothstein" wrote in message
...
No



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Can I customize the Yes/No buttons on a MsgBox?

I've played with subclassing and hooking back in my compiled VB days, but
they are an absolute pain to develop from scratch... you can expect many
crashes along the way and probably unstable performance if you don't attend
to all the requisite details along the way. Of course, if you have a
reference to fully debugged code, then copy/pasting subclassing and/or
hooking code should probably be alright, but my personal preference is to
avoid subclassing and hooking unless forced into having to use them.

--
Rick (MVP - Excel)


"Harald Staff" wrote in message
...
Rick

Just for fun: http://tinyurl.com/avqk9k

Best wishes Harald

"Rick Rothstein" wrote in message
...
No




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 449
Default Can I customize the Yes/No buttons on a MsgBox?

Absolutely, Rick.
As Mrs Krabappel said to Bart's class, after showing a film about human
reproduction:
"Now that you know how to do it: Don't !"

Best wishes Harald

"Rick Rothstein" wrote in message
...
I've played with subclassing and hooking back in my compiled VB days, but
they are an absolute pain to develop from scratch... you can expect many
crashes along the way and probably unstable performance if you don't
attend to all the requisite details along the way. Of course, if you have
a reference to fully debugged code, then copy/pasting subclassing and/or
hooking code should probably be alright, but my personal preference is to
avoid subclassing and hooking unless forced into having to use them.

--
Rick (MVP - Excel)




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,311
Default Can I customize the Yes/No buttons on a MsgBox?

Thanks Rick. I already knew I could do it easily with a UserForm. I just
figured I'd ask about the standard message box since I didn't personally
know of a way. Never hurts to ask.

Thanks,
Paul


--

"Rick Rothstein" wrote in message
...
No; however, you can create your own "message box" using a UserForm with a
Label and two CommandButtons on it. Another possibility is to use the
standard MessageBox and customize your question so that Yes/No makes sense
as an answer. For example, your message could read something like this...

You are about to select either "One" or "Two". Would you like to select
"One"?

Personally, I would create my own "message box" using the UserForm.

--
Rick (MVP - Excel)


"PCLIVE" wrote in message
...
Can I customize the MsgBox vbYesNo buttons to saw whatever I want?
Example: Instead of the buttons saying "Yes" and "No", am I able to make
them say "One" and "Two"?

n = MsgBox("test", vbYesNo)

Thanks in advance.
Paul


--






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Can I customize the Yes/No buttons on a MsgBox?

Just an added note, Paul. The standard dialog boxes like InputBox, MsgBox,
SaveAs, etc. are Windows level forms and are not Excel Application specific.
So when you modify one of them, they are modified for every Windows
application and will show up in Outlook, PowerPoint, Word, Access or whatever
other Windows based application you have. As Rick pointed out, it is much
easier to design your own form and write much less and much simpler code to
achieve your end goal.

"PCLIVE" wrote:

Thanks Rick. I already knew I could do it easily with a UserForm. I just
figured I'd ask about the standard message box since I didn't personally
know of a way. Never hurts to ask.

Thanks,
Paul


--

"Rick Rothstein" wrote in message
...
No; however, you can create your own "message box" using a UserForm with a
Label and two CommandButtons on it. Another possibility is to use the
standard MessageBox and customize your question so that Yes/No makes sense
as an answer. For example, your message could read something like this...

You are about to select either "One" or "Two". Would you like to select
"One"?

Personally, I would create my own "message box" using the UserForm.

--
Rick (MVP - Excel)


"PCLIVE" wrote in message
...
Can I customize the MsgBox vbYesNo buttons to saw whatever I want?
Example: Instead of the buttons saying "Yes" and "No", am I able to make
them say "One" and "Two"?

n = MsgBox("test", vbYesNo)

Thanks in advance.
Paul


--







  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 449
Default Can I customize the Yes/No buttons on a MsgBox?

Hi Paul

It is possible, using lots of complicated windows code, but absolutely not
worth the effort. See
http://www.dailydoseofexcel.com/arch...message-boxes/
for a better and more flexible solution.

HTH. Best wishes Harald

"PCLIVE" wrote in message
...
Can I customize the MsgBox vbYesNo buttons to saw whatever I want?
Example: Instead of the buttons saying "Yes" and "No", am I able to make
them say "One" and "Two"?

n = MsgBox("test", vbYesNo)

Thanks in advance.
Paul


--




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
customize buttons greg Excel Programming 1 February 8th 07 06:49 PM
Customize a button on a MsgBox? quartz[_2_] Excel Programming 3 January 10th 05 10:06 PM
msgbox with no buttons jkitzy Excel Programming 1 December 30th 04 02:58 AM
How can I customize the buttons in a MSGBOX? psdeckers Excel Programming 3 November 4th 04 08:07 AM
Customize options in a MsgBox Darrin Henry Excel Programming 2 September 11th 03 10:06 PM


All times are GMT +1. The time now is 12:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"