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.
 

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