Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
Navigating between option buttons is not selecting the option drhalter Excel Programming 1 June 3rd 05 02:28 PM
Navigating between option buttons is not selecting the option Gixxer_J_97[_2_] Excel Programming 4 June 2nd 05 02:50 PM
Make Combobox act like autofilter andrewbears Excel Programming 1 January 4th 05 05:57 PM
VBA question - autofilter combobox ajliaks[_11_] Excel Programming 2 April 17th 04 12:21 PM
Combobox populating based on Option Button Todd Huttenstine[_2_] Excel Programming 7 November 9th 03 10:18 PM


All times are GMT +1. The time now is 06:44 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"