Input Box Default Value

  • Thread starter Thread starter Sandy
  • Start date Start date
S

Sandy

Hi
How do I set the default value for an input box to the value in F13 on
"mysheet"

Thanks
 
Sandy,

Look up "InputBox" in VBA Help.

The arguments for the InputBox function are:
-prompt
-title
-default
-xpos
-ypos
-helpfile
-context

....in that order

"prompt" is the message to the user inside the box.
"title" is what shows up in the title bar of the textbox.
"default" is the default value in the box.

for example:
pstrAnswer = InputBox("Please enter a value:", "Value Needed","This is the
default value")

HTH,

Conan
 
myVar = InputBox("Your Prompt Here", "Dialog Box Title Here", _
Default:=Range("F13").Value)
 
More explicit:

myVar = InputBox("Your Prompt Here", "Dialog Box Title Here", _
Default:=mySheet.Range("F13").Value)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top