merging excel files in different sheets

  • Thread starter Thread starter banavas
  • Start date Start date
B

banavas

Dear Friends,

I have 2 excel files (maybe more) sefor_1 & sefor_2 with 65500 row
each.
I want to copy the contents of sefor_2 in a second sheet of sefor_1.
Using the following code:

' while having the sefor_2 activated
Cells.Copy
Windows("sefor_1").Activate
ActiveWorkbook.Sheets.Add
ActiveSheet.Paste
Sheets("Sheet1").Name = "sefor_2"
Application.CutCopyMode = False

it corrupts at:
Windows("sefor_1").Activate

Any ideas how to overcome this?

Thanks,
G
 
How about:

Worksheets(Name of the worksheet to be copied from Sefor_2).Cop
after:=WorkBooks("Sefor_1").Sheets(Name of worksheet in Sefor_1)

This should copy the wanted sheet in sefor_2 right after the sheet i
Sefor_1 as a new Sheet.

Best Regards

Noo
 
How about:

Worksheets(Name of the worksheet to be copied from Sefor_2).Cop
after:=WorkBooks("Sefor_1").Sheets(Name of worksheet in Sefor_1)

This should copy the wanted sheet in sefor_2 right after the sheet i
Sefor_1 as a new Sheet.

Best Regards

Noo
 

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