?
Solved

VBA filters

Posted on 2016-10-16
2
Medium Priority
?
97 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
Haris Djulic earned 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

765 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