Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Sheets("sheet1").Range command between workbooks

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Sheets("sheet1").Range command between workbooks

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Sheets("sheet1").Range command between workbooks

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Sheets("sheet1").Range command between workbooks

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
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
Sheets("Sheet1").Cells.ClearContents Seeker Excel Discussion (Misc queries) 2 October 1st 09 12:00 PM
How to TURN OFF "wrap text" for all new workbooks/sheets MK Excel Discussion (Misc queries) 3 March 16th 07 01:03 PM
"Subscript out of range" error for: Workbooks("Test1.xls").Save Just12341234 Excel Programming 2 June 17th 05 03:16 PM
FileCopy Command Giving "Subscript Out of Range" Error Message Jim Hagan Excel Programming 2 June 15th 05 06:07 PM
Range only works when Sheet Name is "Sheet1" paul reed Excel Programming 4 September 14th 03 08:37 PM


All times are GMT +1. The time now is 03:44 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"