PC Review


Reply
Thread Tools Rate Thread

Copy data from one workbook to another existing workbook

 
 
Mads
Guest
Posts: n/a
 
      17th Aug 2007
Hi there,

Maybe somebody here can give med a little help on the following
problem:


I have a "Master"-workbook containing a lot of data, sheets and vba-
code. From this master workbook I need to control another EXISTING
workbook to which I need 1) to copy two columns in a specified sheet
in the master workbook to a specified sheet in the existing workbook
and 2) running vba code (macros) in the existing workbook - both from
within the maste workbook. Preferable I don't want to see the
existing
workbook - just letting it have the copied data from the master
workbook and execute the macros and when finished closing the
workbook
again. Is there somebody here who can help me on this task.


I am using excel 2003


Thanks in advance.


Mads

 
Reply With Quote
 
 
 
 
Zone
Guest
Posts: n/a
 
      17th Aug 2007
Mads, This copies columns E and F from Sheet1 of the workbook with the code
in it to columns E and F of Sheet1 of another workbook. Copy the code below
and paste in a standard module of the workbook you want to copy from.
Change the path of the workbook to open as needed. You do not say what
columns you want to copy, so I just used E and F. Change as needed. You
also did not say whether you wanted to insert or paste the columns. Note
also that the workbook to copy to cannot already be open. HTH, James

Sub SaveColsToExisting()
ThisWorkbook.Worksheets("Sheet1").Activate
Columns("e:f").Copy
Application.ScreenUpdating = False
'change path below to desired path
Workbooks.Open "c:\Test\Existing Workbook.xls"
Worksheets("Sheet1").Activate
[e1].Select
ActiveSheet.Paste
[e1].Select
ActiveWorkbook.Close savechanges:=True
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub

"Mads" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi there,
>
> Maybe somebody here can give med a little help on the following
> problem:
>
>
> I have a "Master"-workbook containing a lot of data, sheets and vba-
> code. From this master workbook I need to control another EXISTING
> workbook to which I need 1) to copy two columns in a specified sheet
> in the master workbook to a specified sheet in the existing workbook
> and 2) running vba code (macros) in the existing workbook - both from
> within the maste workbook. Preferable I don't want to see the
> existing
> workbook - just letting it have the copied data from the master
> workbook and execute the macros and when finished closing the
> workbook
> again. Is there somebody here who can help me on this task.
>
>
> I am using excel 2003
>
>
> Thanks in advance.
>
>
> Mads
>



 
Reply With Quote
 
Mads
Guest
Posts: n/a
 
      17th Aug 2007
Perfect - it works as for the copying of data from one worksheet to
another existing worksheet. Thanks Zone.

Then - does anybody here have any idea on how to execute a macro in
another workbook (without activating it) from a "master" workbook??

Mads

 
Reply With Quote
 
Zone
Guest
Posts: n/a
 
      17th Aug 2007
The other workbook doesn't have to be active, but it does have to be open.
James

Application.Run "MyWorkbook.xls!MySub"

"Mads" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Perfect - it works as for the copying of data from one worksheet to
> another existing worksheet. Thanks Zone.
>
> Then - does anybody here have any idea on how to execute a macro in
> another workbook (without activating it) from a "master" workbook??
>
> Mads
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to copy specific data from master workbook to another workbook Mark767 Microsoft Excel Programming 13 1st Sep 2009 08:57 PM
Copy data from a new workbook into an existing workbook Steve Weaver Microsoft Excel Discussion 0 3rd Aug 2009 11:03 AM
Copy data from Workbook Alpha & reorganize it in Workbook Bravo u473 Microsoft Excel Programming 1 31st Oct 2007 02:37 AM
loop through a column on a workbook copying data on each row to another workbook, then copy data back to the original workbook burl_rfc Microsoft Excel Programming 1 1st Apr 2006 08:48 PM
Copy Sheet from One workbook to another EXISTING workbook Ken Soenen Microsoft Excel Programming 2 12th Feb 2006 04:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:07 AM.