Is there anyway to manually enter data into a macro

S

Stighre

Hi,
I am working on an Excel inventory system and I am stumped. I have to enter
a text string of a user (in this case me) before the macro prints out the
form. Is there any command to use that will allow the macro to stop and ask
for a name before continuing?

Thanks,
 
J

JulieD

Hi

yes, you can use the inputbox function for this

e.g.

dim mymsg as string
mymsg = inputbox("What would you like to say?","Personal Message","Hi
There")
msgbox mymsg

Cheers
JulieD
PS only the first parameter (the prompt) is required
 
M

mudraker

Usu Inputbox


This example shows various ways to use the InputBox function to promp
the user to enter a value. If the x and y positions are omitted, th
dialog box is automatically centered for the respective axes. Th
variable MyValue contains the value entered by the user if the use
clicks OK or presses the ENTER key . If the user clicks Cancel,
zero-length string is returned.

Dim Message, Title, Default, MyValue
Message = "Enter a value between 1 and 3" ' Set prompt.
Title = "InputBox Demo" ' Set title.
Default = "1" ' Set default.
' Display message, title, and default value.
MyValue = InputBox(Message, Title, Default)

' Use Helpfile and context. The Help button is added automatically.
MyValue = InputBox(Message, Title, , , , "DEMO.HLP", 10)

' Display dialog box at position 100, 100.
MyValue = InputBox(Message, Title, Default, 100, 100
 
Top