Link to home
Start Free TrialLog in
Avatar of Nirvana
NirvanaFlag for India

asked on

copy from one spreadsheet and paste to another

copy from one spreadsheet to another

I download a report from Oracle,  data from "sheet 1" needs to be copied (Range A1: Y5000) without opening the file and needs to be pasted in 2nd sheet of destination file

Source File can be in any of the excel formats ( XLSX, xls, XLSM)

Destination file is excel 2007 ( paste in the same format of source file)

Please help

Thank you
ASKER CERTIFIED SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ah yes, Dim x and Dim y was my fault...

To Copy active sheet you could use
x.ActiveSheet.Range("A1:Y5000").Copy

and paste to active sheet should work the same way.

You have plenty of methods and properties available in Excel. Look e.g. here: https://msdn.microsoft.com/en-us/VBA/Excel-VBA/articles/workbook-object-excel
Avatar of Nirvana

ASKER

Thank you so much