ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Retaining the default in an input box - again (https://www.excelbanter.com/excel-programming/274612-retaining-default-input-box-again.html)

Gordon Humphreys[_2_]

Retaining the default in an input box - again
 
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!

Wild Bill[_2_]

Retaining the default in an input box - again
 
Don't know but a very simple solution is
Dim foo
Sub Macro1()
foo = InputBox("Fill me", , foo)
End Sub

Tom Ogilvy

Retaining the default in an input box - again
 
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

--
Regards,
Tom Ogilvy




"Gordon Humphreys" wrote in message
...
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!





All times are GMT +1. The time now is 02:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com