Solved

VBA filters

Posted on 2016-10-16
2
38 Views
Last Modified: 2016-10-17
Hi Experts,

As we know that we have filters in excel as shown below:

filters
How can I achieve this in VBA coding e.g. at the click of the button, I have 10 columns in my sheet.

Thanks
meetDinesh
0
Comment
Question by:Dinesh Kumar
2 Comments
 
LVL 15

Accepted Solution

by:
Haris Djulic earned 500 total points
ID: 41846137
From:
https://msdn.microsoft.com/en-us/library/office/ff193884.aspx

Here is code sniplet adjust it according to your need.
Worksheets("Sheet1").Range("A1").AutoFilter _
 field:=1, _
 Criteria1:="Otis", _
 VisibleDropDown:=False
0
 

Author Closing Comment

by:Dinesh Kumar
ID: 41846278
Thanks Harish.

Worksheets("Results").Range("A4:B4").AutoFilter

worked.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now