Read xls sheet contain to another xls sheet by help of MACRO

PRIYARANJAN

New Member
Joined
Apr 20, 2011
Messages
5
Hi,
I have a requirement like:
There is an xls sheet which contain some data.I want to copy the whole content of that xls sheet to another xls sheet(work1.xls).
I have tried following code:


Sub Mover2()

ActiveSheet.Move Before:=Workbooks("work1.xls").Sheets(1)
'Moves active sheet to beginning of named workbook.
'Replace Test.xls with the full name of the target workbook you want.
End Sub




But this is not working fine.
can any body help me regarding the same.....thanks in advance
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi,
I have a requirement like:
There is an xls sheet which contain some data.I want to copy the whole content of that xls sheet to another xls sheet(work1.xls).
I have tried following code:


Sub Mover2()

ActiveSheet.Move Before:=Workbooks("work1.xls").Sheets(1)
'Moves active sheet to beginning of named workbook.
'Replace Test.xls with the full name of the target workbook you want.
End Sub




But this is not working fine.
can any body help me regarding the same.....thanks in advance
Hi plz help me out...
 
Upvote 0
Hi Priyaranjan,

Hopefully this code will work . I have just tried

Sub Mover2()
Dim a As Worksheet
Set a = ActiveSheet
Workbooks.Open Filename:="abc.xls"
a.Move Before:=Workbooks("abc.xls").Sheets("Sheet1")
End Sub

Regards,
Jibanendu:)
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,673
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top