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
 

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

Top