Here is an easy reference code which filters data in the sheet. In the code, we have filtered the data in three steps.
Step 1: Remove existing filter from the sheet (if any). This code ensures if there is already a filter applied then the same is removed first
Step 2: Apply filter on 5th column (E) of the data where Country is Japan
Step 3: Apply filter on 4th column (D) of the data where Department ID is 711
'This function can be used to filter data
Public Sub FilterData()
'
'Reset/Remove filter from sheet
Sheet1.AutoFilterMode = False
'
'Apply first filter on 5th column (E) in the data where Country is Japan
Sheet1.Range("A1:G" & Sheet1.UsedRange.Row).AutoFilter 5, "Japan"
'Apply second filter on 4th column (D) in the data where Department ID is 711
Sheet1.Range("A1:G" & Sheet1.UsedRange.Row).AutoFilter 4, "711"
'
End Sub
Hope You like this article. Please share this with your friends and colleagues.
Happy Reading
How to send bulk emails from outlook using excel VBA? Have you ever felt the need of an Excel based VBA tool or code which can help you to draft Outlook emails in bulk by…
Free File Renamer Tool – Quickly Rename files batch using Excel VBA Here is another help code and tool for programmers to rename files. You can use this tool for renaming all files available in…
File Manager tool is an Excel based tool which helps you to delete or move unwanted files from your system. It requires a source and destination folder (in case you want to move files). First it lists all the files available in the folder or sub-folders then you can select the action to be taken for each file such as Move or Delete. With a click of button, tool will take all necessary actions.
https://youtu.be/c2CtJ1uaXSQ Microsoft Excel is a popular spreadsheet application widely used for data analysis and management. One of the essential skills for working with filter data in Power Query in Excel. Filtering allows you to focus…
Colorindex in Excel VBA Today let’s try to understand how ColorIndex property in Excel VBA works. It is an easy and effective way to quickly complete the development. ColorIndex property is normally used by VBA…
This Excel VBA Code converts the excel range into HTML and also can convert Excel to HTML Table to paste data on Outlook Email Body