Input Box with Validation

  • Thread starter Thread starter Bill Y
  • Start date Start date
B

Bill Y

Hello,

I would like to use the InputBox (method or function) in my macro and have
it constrain the inputs to a named range in the spreadsheet. I would like
to see a drop-down box just as when I use Data>Validation, Allow = List,
Source = <named range>.

The InputBox method includes a Type parameter, which you assign a numeric
value that corresponds to certain data formats. I don't think this will get
me what I need, or if it will I do not understand how.

Any help? Can I have a drop down box in an input window?

Bill
 
By the way, I know I can specify the Default value to be displayed in the
InputBox.

Set myModel = Application.InputBox(prompt:="Enter the Model Number",
Default:=Range("Models"))

When I do this, I do not get a drop down menu. Instead, the first value in
the list is shown as the default value. I cancel the InputBox and another
came up with the second, and then the third, etc, until the end of the list
was reached at which time I got a macro error.

Help says the Default can be a Range, but this behavior just seems useless
when my variable is supposed to be a single value.
 
Back
Top