Copy Data Using Advanced Filter with VBA @Exceltrainingvideos
Copy Data Using Advanced Filter with VBA  @Exceltrainingvideos
Uploaded October 2019 | Updated September 2026, 2 weeks ago
How to copy data from one worksheet to another automatically and quickly using advanced filter with VBA.
Here's the complete VBA code:
Option Explicit

Sub copyData()
Dim rngData As Range, rngCriteria As Range

Set rngData = ThisWorkbook.Worksheets("data").Range("A1").CurrentRegion
Set rngCriteria = ThisWorkbook.Worksheets("data").Range("G1").CurrentRegion

Dim mymonthnum As Integer
mymonthnum = Mid(Range("G2"), 3, 2)
MsgBox mymonthnum

Dim mymonthname As String

mymonthname = MonthName(mymonthnum)

MsgBox mymonthname

ThisWorkbook.Worksheets(mymonthname).Cells.ClearContents

Dim rngOutput As Range
Set rngOutput = ThisWorkbook.Worksheets(mymonthname).Range("A1")

rngData.AdvancedFilter xlFilterCopy, rngCriteria, copytorange:=rngOutput, Unique:=False

ThisWorkbook.Worksheets(mymonthname).Columns.AutoFit

End Sub
Copy Data Using Advanced Filter with VBAEfficiency of Arrays in CalculationsFilter Data for Current Month or YearCreate Multiple Copies of Master Sheet AutomaticallyA Super Simple Inventory Automation SystemAnalyze Data Using DGET FunctionPower BI Desktop Data Analysis VisualizationsHow to Open Most Recent File from Specific FolderDump Web Page Data into Worksheet | 2021Automate Slicer Creation Using Table Data2021 | Forgot Excel Password | How to Remove a Password from Excel | 100% SuccessUpdate Master Sheet with a Click
Dinesh Kumar Takyar |

Copy Data Using Advanced Filter with VBA

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER