Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help creating pull down list with unique names and no blanks

Hi all

I am a newbie and have only basic knowledge of VBA. I have read some tips
from this NG and Pearson's site about creating dynamic range and creating
unique lists. So I have a dynamic range called "Customer" with names in
A10:A25. I have another range called "CustomerUnique" in A30:A45, which is a
list of unique entries in "Customer". This is arrived by using the following
array formula and copying it to fill the range

{=IF(COUNTIF($A$10:A10,A10)=1,A10,"")}

I use the "CustomerUnique" as the list for validation purpose. So cell A5
has a pull down menu for data validation which allow the user to select a
name from "CustomerUnique" and the user is presented only the unique names
to chose. Now this work ok except that I want this pull down menu to give
the following:

1. Unique names only with no duplicates (this part is achieved)
2. Names to be sorted alphabetically (At present cannot sort
"CustomerUnique" using VBA or Excel's sort feature)
3. Avoid blanks from the pull down menu (Currently there are blanks in
between at bottom of list, if at least some entries are same and or when
range is not fully filled up)

The purpose is to do what Autofilter does in Excel, that is allowing to
chose a name and show rows with only with that customers name in the range
"Customer". I am going the VBA way because I want to have many such filters
in the same worksheet, which is not possible if I use the default autofilter
option. I have some basic idea how to do the filtering part with VBA, but
need guidance on creating a pull down list with 3 points mentioned above.

Any help will be appreciated much.

Thanks in advance.




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Help creating pull down list with unique names and no blanks

Smiley, one approach is to copy the column containing the unique entries to
a hidden worksheet and paste special values. Then you can sort the list.
You can get the code for these two tasks by using the macro recorder.

Regarding filling a dropdown list if the sorted list is on a sheet named
"hidden sheet" and in column A, then the following would add the names to
the combobox

For Each cell In Worksheets("hidden sheet").Columns(1)
If IsEmpty(cell) Then Exit For
UserForm1.ComboBox1.AddItem cell.Value
Next

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"smiley" wrote in message
...
Hi all

I am a newbie and have only basic knowledge of VBA. I have read some tips
from this NG and Pearson's site about creating dynamic range and creating
unique lists. So I have a dynamic range called "Customer" with names in
A10:A25. I have another range called "CustomerUnique" in A30:A45, which is

a
list of unique entries in "Customer". This is arrived by using the

following
array formula and copying it to fill the range

{=IF(COUNTIF($A$10:A10,A10)=1,A10,"")}

I use the "CustomerUnique" as the list for validation purpose. So cell A5
has a pull down menu for data validation which allow the user to select a
name from "CustomerUnique" and the user is presented only the unique names
to chose. Now this work ok except that I want this pull down menu to give
the following:

1. Unique names only with no duplicates (this part is achieved)
2. Names to be sorted alphabetically (At present cannot sort
"CustomerUnique" using VBA or Excel's sort feature)
3. Avoid blanks from the pull down menu (Currently there are blanks in
between at bottom of list, if at least some entries are same and or when
range is not fully filled up)

The purpose is to do what Autofilter does in Excel, that is allowing to
chose a name and show rows with only with that customers name in the range
"Customer". I am going the VBA way because I want to have many such

filters
in the same worksheet, which is not possible if I use the default

autofilter
option. I have some basic idea how to do the filtering part with VBA, but
need guidance on creating a pull down list with 3 points mentioned above.

Any help will be appreciated much.

Thanks in advance.






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Help creating pull down list with unique names and no blanks

If you want to use a third range, Chip Pearson shows how to use formulas to
evaluate your unique list and build a list with no blanks:

http://www.cpearson.com/excel/noblanks.htm

This could be done without having the intermediate list I would think - but
the formula would be complex.

--
Regards,
Tom Ogilvy

"smiley" wrote in message
...
Hi all

I am a newbie and have only basic knowledge of VBA. I have read some tips
from this NG and Pearson's site about creating dynamic range and creating
unique lists. So I have a dynamic range called "Customer" with names in
A10:A25. I have another range called "CustomerUnique" in A30:A45, which is

a
list of unique entries in "Customer". This is arrived by using the

following
array formula and copying it to fill the range

{=IF(COUNTIF($A$10:A10,A10)=1,A10,"")}

I use the "CustomerUnique" as the list for validation purpose. So cell A5
has a pull down menu for data validation which allow the user to select a
name from "CustomerUnique" and the user is presented only the unique names
to chose. Now this work ok except that I want this pull down menu to give
the following:

1. Unique names only with no duplicates (this part is achieved)
2. Names to be sorted alphabetically (At present cannot sort
"CustomerUnique" using VBA or Excel's sort feature)
3. Avoid blanks from the pull down menu (Currently there are blanks in
between at bottom of list, if at least some entries are same and or when
range is not fully filled up)

The purpose is to do what Autofilter does in Excel, that is allowing to
chose a name and show rows with only with that customers name in the range
"Customer". I am going the VBA way because I want to have many such

filters
in the same worksheet, which is not possible if I use the default

autofilter
option. I have some basic idea how to do the filtering part with VBA, but
need guidance on creating a pull down list with 3 points mentioned above.

Any help will be appreciated much.

Thanks in advance.






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count unique names in a list Cassie Excel Discussion (Misc queries) 5 March 18th 10 08:47 PM
creating a list from a few worksheets not including blanks Scott Excel Worksheet Functions 0 April 30th 08 12:43 AM
Creating Spreadsheet that pull Names that have a pop. of 10+ Jonathan Excel Worksheet Functions 3 February 1st 08 09:46 PM
formula to pull names out of list Kim Shelton at PDC Excel Discussion (Misc queries) 3 January 23rd 08 05:30 AM
Pull unique names for drop down list [email protected] Excel Discussion (Misc queries) 3 February 1st 05 10:23 PM


All times are GMT +1. The time now is 12:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"