Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to copy and match data from one workbook to another workbook clc_80 Excel Worksheet Functions 1 April 6th 10 11:41 PM
Copy Data from Workbook into specific Worksheet in other Workbook? kingdt Excel Discussion (Misc queries) 1 March 16th 06 06:55 PM
copy excel workbook to new workbook without data Omnitool Excel Worksheet Functions 3 March 14th 06 10:49 PM
Selecting data from 1 workbook to copy and paste to a 2nd workbook JackSpam Excel Programming 2 July 20th 05 02:33 AM
Copy cell data Workbook to Workbook Soli3d Excel Programming 2 February 1st 05 08:47 PM


All times are GMT +1. The time now is 06:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"