Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / December 2006

Tip: Looking for answers? Try searching our database.

Separate Button for Auto Filter Selected Range

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nasir Naqvi - 06 Dec 2006 13:39 GMT
Hi,

How can we creat separate button in MS excel for selected range class in auto filter. If we click on button then only selected range class appears. Should we write script on Macro in VB.

For example,

Button Name "XYZ"

Column A (with Auto Filter)
ABC
XYZ
DEF
XYZ

If we click on button "XYZ" then cell "XYZ" instead of "ABC" & "DEF".

Regards

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
Don Guillett - 06 Dec 2006 15:11 GMT
IF?   you mean that you want to filter the range by the selected column then
you would probably want a double_click event macro to do the autofilter

Signature

Don Guillett
SalesAid Software
dguillett1@austin.rr.com

> Hi,
>
[quoted text clipped - 18 lines]
> EggHeadCafe.com - .NET Developer Portal of Choice
> http://www.eggheadcafe.com
AndrewArmstrong - 06 Dec 2006 15:15 GMT
Create button using Control toolbox, right click on button and select
"view code", then enter the following

Private Sub ButtonXYZ_Click()
   Columns("a:a").AutoFilter Field:=1, Criteria1:="XYZ",
visibledropdown:=False
End Sub

If you wanted to autofilter a specific range, you could replace
columns("a:a") with a range, such as  range("a1:a5")
The visible drop-down is the autofilter arrow that appears in the first
cell in the range, it can be toggled on/off with true/false.

Regards,
Andrew J Armstrong
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.