Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy data from one workbook to another
Hi everyone, I would like to copy data from a sheet in one workbook to another sheet in a differrent workbook. Is there a way to do this automatically? Thank you very much for your help. With your help with this, i will finish up my report automation and it will save me at least 4hrs a week. Thanks! -- Excel_Newbie ------------------------------------------------------------------------ Excel_Newbie's Profile: http://www.excelforum.com/member.php...o&userid=28861 View this thread: http://www.excelforum.com/showthread...hreadid=486456 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy data from one workbook to another
Here is some code that copies form one book to another...
Sub Test() Dim wbkSource As Workbook Dim wbkDestination As Workbook Dim wksSource As Worksheet Dim wksDestination As Worksheet Dim rngSource As Range Dim rngDestination As Range 'Set your source Set wbkSource = ThisWorkbook Set wksSource = wbkSource.Sheets("Sheet1") Set rngSource = wksSource.Cells 'Set your destination On Error GoTo OpenBook Set wbkDestination = Workbooks("ThatBook.xls") On Error GoTo 0 Set wksDestination = wbkDestination.Sheets("Sheet1") Set rngDestination = wksDestination.Range("A1") 'You now have all of your souce and destination objects wksSource.Copy wksDestination rngSource.Copy rngDestination Exit Sub OpenBook: Set wbkDestination = Workbooks.Open("C:\Thatbook.xls") Resume Next Exit Sub End Sub -- HTH... Jim Thomlinson "Excel_Newbie" wrote: Hi everyone, I would like to copy data from a sheet in one workbook to another sheet in a differrent workbook. Is there a way to do this automatically? Thank you very much for your help. With your help with this, i will finish up my report automation and it will save me at least 4hrs a week. Thanks! -- Excel_Newbie ------------------------------------------------------------------------ Excel_Newbie's Profile: http://www.excelforum.com/member.php...o&userid=28861 View this thread: http://www.excelforum.com/showthread...hreadid=486456 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy data from one workbook to another
To copy data from Range("a1:bm500") in WorkBook1.Sheets("A") t WorkBook2.Sheets("C"): Sub CopyWkBookToWkBook() set SourceBk=WorkBooks("Book1") set DestinBk=WorkBooks("Book2") SourceBk.Range("a1:bm500").Copy DestinBk.Range("a1") End Sub David -- david ----------------------------------------------------------------------- davidm's Profile: http://www.excelforum.com/member.php...fo&userid=2064 View this thread: http://www.excelforum.com/showthread.php?threadid=48645 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy data from one workbook to another
Whoops! Incomplete referencing now rectified. To copy data from Range("a1:bm500") in WorkBook1.Sheets("A") to WorkBook2.Sheets("C"): Sub CopyWkBookToWkBook() set SourceBk=WorkBooks("Book1").Sheets("A") set DestinBk=WorkBooks("Book2").Sheets("C") SourceBk.Range("a1:bm500").Copy DestinBk.Range("a1") End Sub David. -- davidm ------------------------------------------------------------------------ davidm's Profile: http://www.excelforum.com/member.php...o&userid=20645 View this thread: http://www.excelforum.com/showthread...hreadid=486456 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need to copy and match data from one workbook to another workbook | Excel Worksheet Functions | |||
Copy Data from Workbook into specific Worksheet in other Workbook? | Excel Discussion (Misc queries) | |||
copy excel workbook to new workbook without data | Excel Worksheet Functions | |||
Selecting data from 1 workbook to copy and paste to a 2nd workbook | Excel Programming | |||
Copy cell data Workbook to Workbook | Excel Programming |