Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting AutoFilter option based on ComboBox value
Looking for some help on this one: I have a combobox on Sheet1 that has multiple names available. Whatever name is selected is linked to cell A1. On Sheet2, I have th same names listed in row A. What I want to do is when a name i selected in the combobox, I want to go to Sheet2, find the cell in ro A that has the matching name, and then pick the AutoFilter button tha is in the same column but 4 rows down from the name, and filter o (NonBlanks). Any help is greatly appreciated...thanks -- clmarque ----------------------------------------------------------------------- clmarquez's Profile: http://www.excelforum.com/member.php...fo&userid=2938 View this thread: http://www.excelforum.com/showthread.php?threadid=49173 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting AutoFilter option based on ComboBox value
This requires that the autofilter dropdowns are already in place on sheet2
(which you imply is the case) Sub SetAutofilter() Dim rng as Range, res as Variant With Worksheets("Sheet2") Set rng = .Rows(1) End With res = Application.Match(Worksheets("Sheet1").Range("A1") , _ rng, 0) If Worksheets("Sheet2").FilterMode Then Worksheets("sheet2").ShowAllData End If If Not IsError(res) Then Worksheets("Sheet2").AutoFilter.Range.AutoFilter _ Field:=res, Criteria1:="<" End If End Sub -- Regards, Tom Ogilvy "clmarquez" wrote in message ... Looking for some help on this one: I have a combobox on Sheet1 that has multiple names available. Whatever name is selected is linked to cell A1. On Sheet2, I have the same names listed in row A. What I want to do is when a name is selected in the combobox, I want to go to Sheet2, find the cell in row A that has the matching name, and then pick the AutoFilter button that is in the same column but 4 rows down from the name, and filter on (NonBlanks). Any help is greatly appreciated...thanks! -- clmarquez ------------------------------------------------------------------------ clmarquez's Profile: http://www.excelforum.com/member.php...o&userid=29386 View this thread: http://www.excelforum.com/showthread...hreadid=491737 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting AutoFilter option based on ComboBox value
Worked like a charm... I like how you added the lines to unfilter the data, just in case it was already filtered in some way - it is definitely needed. Thanks, Kez -- clmarquez ------------------------------------------------------------------------ clmarquez's Profile: http://www.excelforum.com/member.php...o&userid=29386 View this thread: http://www.excelforum.com/showthread...hreadid=491737 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Navigating between option buttons is not selecting the option | Excel Programming | |||
Navigating between option buttons is not selecting the option | Excel Programming | |||
Make Combobox act like autofilter | Excel Programming | |||
VBA question - autofilter combobox | Excel Programming | |||
Combobox populating based on Option Button | Excel Programming |