View Single Post
  #5   Report Post  
JE McGimpsey
 
Posts: n/a
Default How copy cell workbook to workbook?

They're not arrays, they're collections.

See the "Workbooks Collection Object" and "Worksheets Collection Object"
entries in XL/VBA Help.

In article ,
Gary''s Student wrote:

I don't see where the arrays Workbooks() and Worksheets() are set.
--
Gary''s Student


" wrote:

Can someone tell me why this isn't copying cell 2,3 in 2nd workbook to
cell 5,2 in 1st workbook? It prints the msgbox properly and runs w/o
runtime errors.

Sub Copy_Cell_from_2ndbook_to_1st_book()
Workbooks(1).Worksheets(1).Cells(5, 2).Value =
Workbooks(2).Worksheets(1).Cells(2, 3).Value
MsgBox "Done"
End Sub

Thanks!