MsgBox to read a value

mtheriault2000

Well-known Member
Joined
Oct 23, 2008
Messages
826
Hello

I know that i could use MsgBox to read a yes no answer. Is it possible to use it to read and integer number?

I'm displaying a list of option like
ShowMessage =
1: abcd & chr(10)
2: efgh & chr(10)
3: qwer

Rep = msgbox(ShowMessage, ???)

How could i read the answer from the user?

Martin
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hello,

If you would like Multiple Choice, why not use an InputBox?

Using a MsgBox would entail many Yes/No type questions to arrive at an answer.


<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> a()<br><SPAN style="color:#00007F">Dim</SPAN> showmessage <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">String</SPAN><br><br>showmessage = "Choose 1, 2 or 3" & Chr(10) & "1: abcd" & Chr(10) & "2: efgh" & Chr(10) & "3: qwer"<br><br><SPAN style="color:#00007F">Select</SPAN> <SPAN style="color:#00007F">Case</SPAN> InputBox(showmessage)<br>    <SPAN style="color:#00007F">Case</SPAN> 1<br>        MsgBox 1<br>    <SPAN style="color:#00007F">Case</SPAN> 2<br>        MsgBox 2<br>    <SPAN style="color:#00007F">Case</SPAN> 3<br>        MsgBox 3<br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Select</SPAN><br><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,261
Members
452,901
Latest member
LisaGo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top