Retaining the default in an input box - again

  • Thread starter Thread starter Gordon Humphreys
  • Start date Start date
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?
 
Don't know but a very simple solution is
Dim foo
Sub Macro1()
foo = InputBox("Fill me", , foo)
End Sub
 
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

Back
Top