Excel VBA - InputBox DEFAULT Value?

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
 
T

Tom Ogilvy

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.
 
S

steveB

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
 
Top