ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to reference to an other excell book to get the value (https://www.excelbanter.com/excel-programming/380164-how-reference-other-excell-book-get-value.html)

noyau

How to reference to an other excell book to get the value
 
The following logic exist to form an archive of the changing values of A1
and A2 [.Cells(xlr, 8) = .Range("A1")]. How the term [.Range("A1")] will
change if the cell A1 is from an other excel book (a "book1" in the desktop)?

Sub ArchiveA2()
Dim xlr As Long
With Sheets("Sheet1")
.Range("G1") = "Value"
xlr = .Cells(Rows.Count, "G").End(xlUp).Row + 1
.Cells(xlr, 7) = Format(Date, "dd/mm/yyyy")
.Cells(xlr, 8) = .Range("A1")
.Cells(xlr, 9) = .Range("A2")
End With
End Sub



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

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