Copy data from one workbook to another
i have installed windows xp. I would like to know how to copy data from one one sheet to another, suppose copy data of sheet 1 within the excel file ( file1.xls ) to the the file2.xls in excel 2003. That means this both sheet belongs to different spreadsheet(Excel).
Re: Copy data from one workbook to another
Use this script to copy data from one sheet to another :
Code:
Set objExcel = CreateObject("Copy File.Application")
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Open("c:\Scripts\Test.xls")
Set objWorksheet = objWorkbook.Worksheets("sheet number 1")
Set objRange = objWorksheet.Range("A1:A20")
objRange.Copy
Set objExcel2 = CreateObject("Copy File.Application")
objExcel2.Visible = True
Set objWorkbook2 = objExcel2.Workbooks.Add
Set objWorksheet2 = objWorkbook2.Worksheets("sheet number 1")
objWorksheet2.Paste
Re: Copy data from one workbook to another
There is another way to do this. Select view tab in the workbook from which you want to copy. Click on select Macros then record macro. After that copy data from workbook and paste in to 2nd workbook where you changed all that setting. After copying data click on stop recording button. In this way can copy data from one workbook to another.
Re: Copy data from one workbook to another