Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like to use the e.g.
Sheets("sheet1").Range("ac2") = Sheets("sheet2").Range("b2") command (which works within a wookbook) but between 2 workbooks. How can I impose a value of workbook1 to workbook2 in the assumption that wookbook2 is open? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
General form is:
Workbooks("Workbook1").Worksheets("Sheet1").Range( "ac2")=Workbooks("Workbook2").Worksheets("Sheet2") .Range("b2") Substitute in your workbook names (exactly as they show in the Excel title bar when the workbook is open, or in the Project Explorer list in the VBA editor). -- - K Dales "Luc" wrote: I would like to use the e.g. Sheets("sheet1").Range("ac2") = Sheets("sheet2").Range("b2") command (which works within a wookbook) but between 2 workbooks. How can I impose a value of workbook1 to workbook2 in the assumption that wookbook2 is open? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks works
"K Dales" wrote: General form is: Workbooks("Workbook1").Worksheets("Sheet1").Range( "ac2")=Workbooks("Workbook2").Worksheets("Sheet2") .Range("b2") Substitute in your workbook names (exactly as they show in the Excel title bar when the workbook is open, or in the Project Explorer list in the VBA editor). -- - K Dales "Luc" wrote: I would like to use the e.g. Sheets("sheet1").Range("ac2") = Sheets("sheet2").Range("b2") command (which works within a wookbook) but between 2 workbooks. How can I impose a value of workbook1 to workbook2 in the assumption that wookbook2 is open? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try something like
Workbooks("Book2.xls").Sheets("sheet1").Range("ac2 ") = _ Workbooks("Book1.xls").Sheets("sheet2").Range("b2" ) -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Luc" wrote in message ... I would like to use the e.g. Sheets("sheet1").Range("ac2") = Sheets("sheet2").Range("b2") command (which works within a wookbook) but between 2 workbooks. How can I impose a value of workbook1 to workbook2 in the assumption that wookbook2 is open? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sheets("Sheet1").Cells.ClearContents | Excel Discussion (Misc queries) | |||
How to TURN OFF "wrap text" for all new workbooks/sheets | Excel Discussion (Misc queries) | |||
"Subscript out of range" error for: Workbooks("Test1.xls").Save | Excel Programming | |||
FileCopy Command Giving "Subscript Out of Range" Error Message | Excel Programming | |||
Range only works when Sheet Name is "Sheet1" | Excel Programming |