• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 113
  • Last Modified:

VBA filters

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
Dinesh Kumar
Asked:
Dinesh Kumar
1 Solution
 
Haris DjulicCommented:
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
 
Dinesh KumarAuthor Commented:
Thanks Harish.

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

worked.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now