By: Willy Huang

How to Copy closed-Worksheet to Another closed-Workbook Using VBA ?

I modified your code as below, but I got a error at “Workbooks(“File01.xlsx”).Sheets(“Sheet1″).Copy Before:=closedbook.Sheets(1) ”

Sub VBAcopytest()

Dim closedbook As Workbook

Application.ScreenUpdating = False

Set closedbook = _
Workbooks.Open _
(“C:\Users\willy\OneDrive\dataNAVtest2\File02.xlsm”)

Workbooks(“File01.xlsx”).Sheets(“Sheet1”).Copy Before:=closedbook.Sheets(1)
closedbook.Close SaveChanges:=True
Application.ScreenUpdating = True

End Sub