Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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
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
Auto Populate Date when specific entry is chosen from data validation btrich14 Excel Worksheet Functions 1 August 4th 10 03:56 PM
how do i set to only see chosen rows and columns in excel Rasput1m Excel Discussion (Misc queries) 4 April 8th 08 10:33 PM
Auto-filtering based on a value chosen in a combo box? Dan Excel Discussion (Misc queries) 0 November 6th 07 03:51 PM
Populate one combo box based on the selection of another combo box Alex Excel Programming 8 April 19th 07 06:40 PM
Trouble manipulating worksheet chosen from combo box PV Jefe Excel Programming 2 September 28th 06 03:30 PM


All times are GMT +1. The time now is 11:02 AM.

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"