merging excel files in different sheets

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
 
N

NooK

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
 
N

NooK

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
 
Top