Retaining the default in an input box - again

G

Gordon Humphreys

I have as suggested by Tom Ogilvy, looked at Input box help again but
failed to find how to retain as default THE STRING LAST ENTERED BY THE
USER (as doable in old steam Excel).

Any further suggestions - or has the facility fallen by the wayside?



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
W

Wild Bill

Don't know but a very simple solution is
Dim foo
Sub Macro1()
foo = InputBox("Fill me", , foo)
End Sub
 
T

Tom Ogilvy

INPUT(message_text, type_num, title_text, default, x_pos, y_pos, help_ref)

=INPUT("Use this again or overwrite",3, "Enter accountingdate", Z99)

message_text = "Use this again or overwrite"
type_num = 3
title_text = "Enter accountingdate"
default = Z99


The equivalent in VBA:

expression.InputBox(Prompt, Title, Default, Left, Top, HelpFile,
HelpContextId, Type)


res = Application.InputBox(Prompt:="Use this again or overwrite", _
Title:="Enter accountingdate", _
Default:=worksheets("Sheet1").Range("Z99"), _
Type:=3)
worksheets("Sheet1").Range("Z99").Value = res
 
Top