Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to refer to an other worksheet (or book)
The following logic exist to form an archive of the changing values of A1 and A2 (.Cells(xlr, 8) = .Range("A1")). What if A1 value of an other excel sheet (or book) (other then "sheet1") is referenced? 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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to refer to an other worksheet (or book)
Thank you Alok, that will solve my problems. I wonder how I should move in order to reference to an other Excel Book (for example a "Book1" in the desktop) instead of just another sheet. I was unable to get a solution from my trials and from help menu. "Alok" wrote: Hi noyau, The following line will change .Cells(xlr, 8) = Worksheets("Sheet2").Range("A1") Alok "noyau" wrote: The following logic exist to form an archive of the changing values of A1 and A2 (.Cells(xlr, 8) = .Range("A1")). What if A1 value of an other excel sheet (or book) (other then "sheet1") is referenced? 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Refer to worksheet | Excel Programming | |||
refer to specific worksheet | Excel Programming | |||
How can I refer a particular Sheet in a work book from a word doc | Excel Programming | |||
Using a txt string to refer to other work book | Excel Worksheet Functions | |||
Q - Excel 2000: How to refer to worksheet in the same book? | Excel Worksheet Functions |