Different methods of importing an Excel spreadsheet into a different spreadsheet using VBA

Import whole sheet

 Set currentWorkbook = ThisWorkbook ' The workbook where the script is running
 Set sourceWorkbook = Workbooks.Open(folderPath & latestFile)

 ' Copy the first sheet from the source file
 Set sourceSheet = sourceWorkbook.Sheets(1)

 ' Copy content from source sheet to destination sheet
 sourceSheet.Range("A:D").Copy Destination:=currentWorkbook.Worksheets("Carrier bags").Range("A1")

 ' Close the source workbook without saving
 sourceWorkbook.Close SaveChanges:=False

Categorized in:

VBA Excel,

Last Update: March 4, 2025