Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Populate combo box, then hide rows that don't match chosen value
I have a sheet at work that is constantly adding rows to add more
items and their details to it. Items are added and associated by a category in A4:A9999. I want to have a combo box that will only show the rows for a given category, then hide rows not equal to the value chosen. So: a) determine all distinct values in A4:A9999 and populate the combo box with these values in real time if that won't be too hard on the CPU, but somehow update it. b) Then, when the user chooses a value from the combo box, all rows are hidden except the A:A cells equal to the value and the A1:A3 (headers) I am stuck on how to do a). any ideas? thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Populate combo box, then hide rows that don't match chosen value
Use advance Filters like below
Sub MakeComboBox() With Sheets("Sheet1") .ComboBox1.Clear If .FilterMode Then .ShowAllData End If .Columns("A").AdvancedFilter _ Action:=xlFilterInPlace, _ unique:=True Set UniqueData = .Columns("A").SpecialCells(xlCellTypeVisible) For Each FltData In UniqueData If FltData.Value < "" Then .ComboBox1.AddItem FltData.Value End If Next FltData If .FilterMode Then .ShowAllData End If End With End Sub "Finny" wrote: I have a sheet at work that is constantly adding rows to add more items and their details to it. Items are added and associated by a category in A4:A9999. I want to have a combo box that will only show the rows for a given category, then hide rows not equal to the value chosen. So: a) determine all distinct values in A4:A9999 and populate the combo box with these values in real time if that won't be too hard on the CPU, but somehow update it. b) Then, when the user chooses a value from the combo box, all rows are hidden except the A:A cells equal to the value and the A1:A3 (headers) I am stuck on how to do a). any ideas? thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Auto Populate Date when specific entry is chosen from data validation | Excel Worksheet Functions | |||
how do i set to only see chosen rows and columns in excel | Excel Discussion (Misc queries) | |||
Auto-filtering based on a value chosen in a combo box? | Excel Discussion (Misc queries) | |||
Populate one combo box based on the selection of another combo box | Excel Programming | |||
Trouble manipulating worksheet chosen from combo box | Excel Programming |