PDA

View Full Version : Copy Worksheet to another Workbook - VBA



CC268
01-20-2017, 10:37 AM
I have a Workbook named reportQue.xls with one sheet named "reportQue". I simply need to copy sheet "reportQue" into a workbook that I have named "As Built Template".

Note: Both the reportQue.xls and As Built Template.xlsm files will be open when this VBA code is ran. No need for code that will open and close them.

Thanks!

barim
01-20-2017, 02:36 PM
Thisworkbook.Sheets("reportQue").Copy After:=Workbooks("As Built Template.xlsx").Sheets(Sheets.Count)
ActiveSheet.Name = "MyReport"


I am not sure if this is going to work for you, but at least it will lead you to good direction.

SamT
01-20-2017, 07:45 PM
Good start, barim. I am using your top line of code below.

In a module in reportQue.xls

Sub InsertReportQueSheet()
ThisWorkbook.Sheets("reportQue").Copy _
After:=Workbooks("As Built Template.xls") _
.Sheets("Some Sheet Name Here") '<--- Edit to suit
End Sub