ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dropdown list (https://www.excelbanter.com/excel-programming/407045-dropdown-list.html)

snax500

Dropdown list
 
In Excel2000, I have the following code in a macro...

NAME = Application.InputBox("Type in Name to be filtered")

I want the user to use a list box ( with references to
range("o34:o50") instead of InputBox, less chance for spelling errors.
How do I replace the code?

Thanks

Bob Phillips

Dropdown list
 
How about Data Validation? Debra Dalgleish has details on her website at

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"snax500" wrote in message
...
In Excel2000, I have the following code in a macro...

NAME = Application.InputBox("Type in Name to be filtered")

I want the user to use a list box ( with references to
range("o34:o50") instead of InputBox, less chance for spelling errors.
How do I replace the code?

Thanks




JP[_4_]

Dropdown list
 
In addition to Bob's suggestion, you could also use the Type property
to let the user select a range of cells. See for example:

http://www.ozgrid.com/VBA/inputbox.htm

Set rRange = Application.InputBox(Prompt:= _
"Please select a range with your Mouse to be bolded.", _
Title:="SPECIFY RANGE", Type:=8)

If you use Type 8 then the user can select a range.

HTH,
JP

On Mar 3, 4:15*pm, snax500 wrote:
In Excel2000, I have the following code in a macro...

NAME = Application.InputBox("Type in Name to be filtered")

I want the user to use a list box ( with references to
range("o34:o50") instead of InputBox, less chance for spelling errors.
How do I replace the code?

Thanks



snax500

Dropdown list
 
I wanted to have it within the macro so that a listbox pops on the
screen, the user chooses the name and then my macro takes the user
picked name and filters the data. I did not want data validation.


On Mar 3, 4:35*pm, "Bob Phillips" wrote:
How about Data Validation? Debra Dalgleish has details on her website at

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"snax500" wrote in message

...



In Excel2000, I have the following code in a macro...


NAME = Application.InputBox("Type in Name to be filtered")


I want the user to use a list box ( with references to
range("o34:o50") instead of InputBox, less chance for spelling errors.
How do I replace the code?


Thanks- Hide quoted text -


- Show quoted text -



JP[_4_]

Dropdown list
 
You could create a userform on the fly and populate a listbox with the
list of named ranges from your worksheet. Seems like a big project
though.


HTH,
JP


On Mar 3, 4:45*pm, snax500 wrote:
I wanted to have it within the macro so that a listbox pops on the
screen, the user chooses the name and then my macro takes the user
picked name and filters the data. I did not want data validation.


Bob Phillips

Dropdown list
 
You could easily use the value selected in DV in your macro.

BTW, that website was http://www.contextures.com/xlDataVal01.html

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"snax500" wrote in message
...
I wanted to have it within the macro so that a listbox pops on the
screen, the user chooses the name and then my macro takes the user
picked name and filters the data. I did not want data validation.


On Mar 3, 4:35 pm, "Bob Phillips" wrote:
How about Data Validation? Debra Dalgleish has details on her website at

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"snax500" wrote in message

...



In Excel2000, I have the following code in a macro...


NAME = Application.InputBox("Type in Name to be filtered")


I want the user to use a list box ( with references to
range("o34:o50") instead of InputBox, less chance for spelling errors.
How do I replace the code?


Thanks- Hide quoted text -


- Show quoted text -





All times are GMT +1. The time now is 03:47 AM.

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