Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Combobox list

Hi,

Is it possible to have the contents of a combobox list filterd depending on
the contents of a partcular cell.

e.g. Lets say I have a data range on sheet1 A1:G1000
combobox1 uses range sheet1 A1:1000 for it's list, this does not have does
not have unique records in the range and returns the selected value to cell
a1 on sheet2.

Q1. Can this be set to return unique values in the list?

I then want the contents of the list for combobox2 to use the range Sheet1
B1:1000 (which has unique record) but be filterd by the selection made in
combobox1. This will save users scroling through 1000 records to find the
item in the list in combobox2

Thanks
Pete


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Combobox list

Pete, you can use the advanced filter to filter the first list to a hidden
sheet, and then use the entries on that sheet to populate the combobox:
(untested)

'clear destination range
thisworkbook.sheets(1).columns(1).clear
'filter data range
sheets("sheetwithdata").Range("A1:A1000").Advanced Filter
Action:=xlFilterCopy, _
CopyToRange:=thisworkbook.sheets(1).Range("a1"), Unique:=True
dim lastcell as range
'get last cell with entry
set lastcell = thisworkbook.sheets(1).cells(65536,1).end(xlup)
'get first cell
set startcell = thisworkbook.sheets(1).range("a1")
'set row source
userform1.combobox1.rowsource =
range(startcell,lastcell).address(exterenal:=true)

sheets("sheet2).range("a1").value = userform1.combobox1.value

You could use a similar approach for filtering the list for the second combo
box.

Bob Flanagan
Macro Systems
Delaware, U.S. 302-234-9857
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel



"Pete" wrote in message
...
Hi,

Is it possible to have the contents of a combobox list filterd depending

on
the contents of a partcular cell.

e.g. Lets say I have a data range on sheet1 A1:G1000
combobox1 uses range sheet1 A1:1000 for it's list, this does not have

does
not have unique records in the range and returns the selected value to

cell
a1 on sheet2.

Q1. Can this be set to return unique values in the list?

I then want the contents of the list for combobox2 to use the range Sheet1
B1:1000 (which has unique record) but be filterd by the selection made in
combobox1. This will save users scroling through 1000 records to find the
item in the list in combobox2

Thanks
Pete




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
ComboBox dropdown list? Tdp Excel Discussion (Misc queries) 0 October 14th 08 11:34 PM
.AddItem list and populating combobox with created list pallaver Excel Discussion (Misc queries) 8 June 27th 08 12:36 PM
dependant combobox list L Sholes New Users to Excel 1 April 10th 06 11:29 AM
ComboBox List steve Excel Programming 0 August 26th 03 04:59 PM
ComboBox List Ron de Bruin Excel Programming 0 August 26th 03 04:59 PM


All times are GMT +1. The time now is 01:11 PM.

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

About Us

"It's about Microsoft Excel"