ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   copy text between 2 open workbooks via macro (https://www.excelbanter.com/excel-worksheet-functions/41024-copy-text-between-2-open-workbooks-via-macro.html)

bigdaddy3

copy text between 2 open workbooks via macro
 
i would like to copy addresses from 1 workbook to another workbook
automatically using a macro while both are open, there are only 10 cells
involved and i am
already using a macro to call up a worksheet from the first workbook via
button control. Any suggestions or would i have to use copy and paste which
i dont really want to do.

--
BD3

Duke Carey

You don't need to copy & paste. You can use code along the lines of the
following, where you want to copy the data into Sheet1 of Target.xls

With workbooks("target.xls").worksheets("Sheet1")
.range("A1")=activesheet.range("A1")
.range("B1")=activesheet.range("B1")
etc
End With


"bigdaddy3" wrote:

i would like to copy addresses from 1 workbook to another workbook
automatically using a macro while both are open, there are only 10 cells
involved and i am
already using a macro to call up a worksheet from the first workbook via
button control. Any suggestions or would i have to use copy and paste which
i dont really want to do.

--
BD3


bigdaddy3

Hi Duke,thanks for that where would the code be put in the open event
--
BD3


"Duke Carey" wrote:

You don't need to copy & paste. You can use code along the lines of the
following, where you want to copy the data into Sheet1 of Target.xls

With workbooks("target.xls").worksheets("Sheet1")
.range("A1")=activesheet.range("A1")
.range("B1")=activesheet.range("B1")
etc
End With


"bigdaddy3" wrote:

i would like to copy addresses from 1 workbook to another workbook
automatically using a macro while both are open, there are only 10 cells
involved and i am
already using a macro to call up a worksheet from the first workbook via
button control. Any suggestions or would i have to use copy and paste which
i dont really want to do.

--
BD3



All times are GMT +1. The time now is 02:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com