ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can I customize the Yes/No buttons on a MsgBox? (https://www.excelbanter.com/excel-programming/423490-can-i-customize-yes-no-buttons-msgbox.html)

PCLIVE

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


--




Harald Staff[_2_]

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


--





Rick Rothstein

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


--





Harald Staff[_2_]

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




PCLIVE

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


--







Rick Rothstein

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





JLGWhiz

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


--








Harald Staff[_2_]

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)




All times are GMT +1. The time now is 01:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com