Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copy data from one workbook to another existing workbook

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 373
Default Copy data from one workbook to another existing workbook

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" wrote in message
ups.com...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copy data from one workbook to another existing workbook

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 373
Default Copy data from one workbook to another existing workbook

The other workbook doesn't have to be active, but it does have to be open.
James

Application.Run "MyWorkbook.xls!MySub"

"Mads" wrote in message
oups.com...
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
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
Copy image from existing workbook / template Dan Kelly Excel Programming 2 March 14th 07 03:40 PM
1.Open workbook. 2 copy data. 3 replace data. 4 save workbook. Cristobalitotom Excel Programming 0 July 6th 06 12:24 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 Excel Programming 1 April 1st 06 08:48 PM
Copy Sheet from One workbook to another EXISTING workbook Ken Soenen Excel Programming 0 February 12th 06 04:07 PM
Copy only some existing worksheets to a new workbook munt via OfficeKB.com Excel Programming 5 November 3rd 05 01:03 AM


All times are GMT +1. The time now is 07:56 PM.

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

About Us

"It's about Microsoft Excel"