Copy excel sheet to another excel file

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

Guest

What code will help me with copying an excel sheet to another ecel file.

I open two excel files with code in Access environment.

Now I want values from one sheet to another (Pastespecial only the values)...

Where can I find info about this matter?

Thx,
Zurn
 
Zurn,

You should ask your question in one of the Excel newsgroups.

This newsgroup is for the Access database.

HTH
 
Hi Zurn,
if you want to copy before a sheet in the destination Excel file:

xlApp.Sheets("Sheet1").Copy
Workbooks("MyOtherWorkBook.xls").Sheets(1)

if you want to copy after a sheet in the destination Excel file (notice the
comma):

xlApp.Sheets("Sheet1").Copy ,
Workbooks("MyOtherWorkBook.xls").Sheets(1)

I assume that you have something like "xlApp" as the object variable for the
Excel.Application.

HTH, :-)

Ed Adamthwaite
 
I did not want a new sheet, I copied the values to the "source" sheet of the
new excel file. Your code was very helpful. Thank you

xlApp.Sheets(1).cells.Copy
xlApp.Workbooks("accessDB.xls").Sheets("source").cells

*Zurn*
 
Back
Top