Visual Basic Text Box

Legs

New Member
Joined
Jan 19, 2003
Messages
4
I am Trying to make a message box with somewhere to enter a persons name so that different responces come onscreen depending on whos name you put in. What do you type in on the visual basic to do this?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Try using an InputBox. Look it up in Help, and if you still can't figure it out, let us know what you've tried (post the code) and we'll help you out.

-Russell
 
Upvote 0
thanks! it worked! this is wot i put:
Sub the2()
Dim msg, style, title, responce, mystring
msg = "Enter name"
style = vbinputbox
title = "What is your Name?"

responce = inputbox(msg, title, style)

If responce = "keiron" Then DoCmd.RunMacro "the"
If responce = "Jon" Then DoCmd.RunMacro "the2"
End Sub

is there a way to then put a message with the responce name in it?
 
Upvote 0

Forum statistics

Threads
1,221,510
Messages
6,160,226
Members
451,632
Latest member
purpleflower26

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