Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select all rows from a drop down list box

Status
Not open for further replies.
Feb 29, 2012
26
GB
Hi

What I am trying to do is have a drop down box that when I select a specific country it brings in all detailed columns from the rows for that country, example

A B C
UK England 1
UK England 2
UK England 3
USA America 1
USA America 2
GER Germany 1

So if I have a drop down box and select GER then I should be able to see

GER Germany 1

and if I select UK I should see the 3 rows,

I know I can use filter but then I have to uncehck all, then find the country, then tick it. I just want to be able to select the country and it brings in the information form the rows where country = the selection.

Could anyone point me in the right direction please.

Thanks
 
2 combo boxes base one on the other

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work" <<Edison>>
 
Hi

Sorry cant figure it out, I added one combo box based on Country, but cant relate it to the other two, could you explain in more detail please.

Thanks
 


hi,

Is there any reason why you are not using the AutoFilter reature of tables? You have no HEADINGS on the table you posted. You should. If you did, then just by turning on the AutoFilter will make what you want REALLY SIMPLE, via a single click!



Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
HI Skip

Sorry the above was just an example, my correct spreadsheet as headings.

I am using Autofilter, but I then have to click, then untick, then tick every time. I basically am trying to get to oern the sheet, select UK and it brings in england, then select GEr and it brings in GErmany, without ticking and unticking.

Eventually I want then to be able to multi select on various columns, for example add a county column, so I could pick UK, England and a county, it then displays all results for the rows with this in.

I think its called dependant drop downlists but not sure.

Thanks
 


What version Excel?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 


With Excel 2007+ versions, you CAN make multiple selections in an AutoFilter.

A control, like a ListBox CAN be used to add functionality to a sheet. But you do have that functionality in the AutoFilter.

If you want to pursue the ListBox option, you will need to use VBA code to take the selected values and apply to a filter. What kind of experience do you have with programming?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Hi

Very little to be honest, I have dabbled but would not say I am experienced.

Perhaps you could suggest a basic example and see how it goes.

many Thanks
 


So you are willing to venture into a brand new somewhat complex coding venture, in order to DUPLICATE an existing Excel feature, necessitating the maintenance of this code when users want other modifications?

If so:
[tt]
1. make sure you have a DISTINCT list of Dominions, for want of a better word, like UK, USA, GER.

2. Insert a FORMS ListBox control object on your sheet.

3. Insert a FORMS Button control object on your sheet.

4. Turn on your macro recorder and record setting the AutoFilter on on column with TWO distinct values in your Source Table, not your list. Please include selecting the sheet containing the Source Table and selecting the cell where the auto filter will be set.

5. COPY your recorded macro

[highlight]6. Post your question, along with your recorded code in forum707.[/highlight]

[/tt]
You want the selections in your ListBox to be the basis of setting an AutoFilter in the Source Data, to display the desired rows. Is that correct?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top