Pulling Array from InputBox

C

cogent

Hello

I would like a default "array" in my input box:

vLBDays = Application.InputBox(Prompt:="Enter LB horizons (in rollovers):",
Title:="Lookback Horizons", Default:="{05,10,20}", Type:=64)

but I cannot get it to work without the brackets. If the user wants
anything other than the default values, he must include brackets which is
annoying and time consuming.

Any ideas?

W
 
A

AA2e72E

vLBDays = Split( Application.InputBox(Prompt:="Enter LB horizons (in rollovers):",Title:="Lookback Horizons", Default:="05,10,20", Type:=64),","

This does not check for Cancel being clicked or OK being clicked with no content in the input box-I am sure you can modify the code to cope with this

Split(string,"delimiter") converts string into an array splitting the string at "delimiter" locations): this array is zero based irrespective of Option Base setting.
 
Top