abdelfattah
Well-known Member
- Joined
- May 3, 2019
- Messages
- 1,460
- Office Version
- 2019
- 2010
- Platform
- Windows
hi
i need help to make my code fast by dictionary i have about 10000 rows to copy data from main sheet to other sheets based on values of column
thanks
i need help to make my code fast by dictionary i have about 10000 rows to copy data from main sheet to other sheets based on values of column
VBA Code:
Sub My_Ad_filter()
Dim Rg As Range
Dim Cret_rg As Range
Dim arr, itm
Application.ScreenUpdating = False
arr = Array(sheet1, sheet2, sheet3, sheet4)
Set Rg = Sheets("g").Range("A14").CurrentRegion
For Each itm In arr
With Sheets(itm & "")
.Range("A14").CurrentRegion.ClearContents
.Range("aa1") = "depart"
.Range("aa2") = itm
Set Cret_rg = .Range("aa1:aa2")
Rg.AdvancedFilter 2, Cret_rg, .Range("A14")
Cret_rg.ClearContents
End With
Next
Application.ScreenUpdating = True
End Sub
thanks