Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

prompting user for information 1

Status
Not open for further replies.

Luis939

MIS
Feb 28, 2003
453
US
How do i create a dialogue box or something, to ask the user for a number, and store that number to use in the macro, ive never done anything where i get data from the user or anything like that, thanks
 
Code:
variablename = InputBox(PromptString)

The above is the simple way to do it - the response is then stored in whatever you've called
Code:
variablename
. If you're looking for something more sophisticated, use the Application object.

Code:
variablename = InputBox(Prompt, Title, Default, Left, Top, HelpFile, HelpContextId, Type)

You can then restrict the user to certain types of variable (eg string, date etc) by specifying a code for
Code:
type
.

Look in teh help file for more details.
 
No worries chief.

That kind of stuff is very easy to pick up if you've got a decent VBA book. You'd be amazed at how proficient you can get in a short space of time.

If you need a recommendation, just let us know.
 
sure, what do u recommend as a good vba book for starters and intermediate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top