Goodmorning everyone,
I have a macro that copies another extrapolated file, but the problem is that the automatic filter has been removed and what am I wrong?
Option Explicit
Public Sub Tester ()
Dim srcWB As Workbook, destWB As Workbook
Dim srcSH As Worksheet, destSH As Worksheet
Dim srcRng As Range, destRng As Range
Const sFile_Sorgente As String = "C: \ Users \ Itaerxga \ Desktop \ s.xlsx"
Const sFoglioSorgente As String = "data" '<< === Edit
Const sFoglio_Destinazione As String = "General"
Const sSource_Interval As String = "E2: AB20000"
Const sPrimaCella_Destinazione As String = "A2"
Set srcWB = Workbooks.Open (sFile_Sorgente)
Set srcSH = srcWB.Sheets (sSourceSheet)
Set srcRng = srcSH.Range (sSource_Interval)
Set destWB = ThisWorkbook
Set destSH = destWB.Sheets (sDestination_Sheet)
Set srcRng = srcSH.Range (sSource_Interval)
Set destRng = destSH.Range (sFirstDestination_Cell)
srcRng.Copy Destination: = destRng
srcWB.Close SaveChanges: = False
End Sub
Then I would like to filter column D from oldest to newest from D2 to D20000.
Thanks for your help