Excel VBA - InputBox DEFAULT Value?

  • Thread starter Thread starter BruceAtkinson
  • Start date Start date
B

BruceAtkinson

Can the DEFAULT parameter in an InputBox, reference a cell? I woul
like to use the value in another cell as the InputBox Default value.
Can this be done? If so, how; especially on another worksheet?
Thanks,
Bruc
 
res = InputBox( Prompt:="Enter something", Default:= _
Worksheets("Sheet3").Range("A9").Value)


or use Worksheets("Sheet3:").Range("A9").Text

if you want it to be entered as it is displayed by the cell.
 
Bruce,

Yep! Here's using a named cell, and using a cell reference...

''''''''''''''''
Dim mssg As String

mssg = InputBox("do your thing", "my thing",
Sheets("Sheet3").Range("Function"))
mssg = InputBox("do your thing", "my thing", Sheets("Sheet3").Range("B5"))
'''''''''''''''''''''
hth
 

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