Copy worksheet without code behind

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I have to copy a worksheet from one workbook into another workbook, but the
code behind the worksheet must left alone. Could you tell me how?

Clara
 
Hi all,

I have to copy a worksheet from one workbook into another workbook, but the
code behind the worksheet must left alone. Could you tell me how?

Clara

I'm not knowing how to do that with code, but I do know how to do that
manually if it will help.

hit alt+F11 to bring up the VBA editor. Look on the left hand side
you will see a list of open workbooks and the worksheets belonging to
them.
From the COPIED worksheet, double click the sheet name of the copy, a
code window will appear with all the code tha is attached to the
sheet. Select it all and then delete and then go back to the Excel
workbook that is your copy and save that.

Hope that Helps!

-LT
 
Dim srcbook as Workbook, destBook as Workbook
Dim sh as Worksheet
set srcBook = Activeworkbook
set sh = srcBook.Worksheets("SheetName")
set destBook = workbooks("Dest.xls")
With destbook
.Worksheets.Add after:=.worksheets(.worksheets.count)
sh.cells.copy .Worksheets(.worksheets.count).Cells
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top