Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default 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
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
Refer to worksheet Arne Hegefors Excel Programming 2 August 25th 06 01:39 PM
refer to specific worksheet Dirk Nachbar Excel Programming 2 July 21st 06 09:47 AM
How can I refer a particular Sheet in a work book from a word doc Ajay - Publix, Lakeland FL Excel Programming 0 March 17th 06 09:05 PM
Using a txt string to refer to other work book CC-Khriz Excel Worksheet Functions 0 January 26th 06 01:20 PM
Q - Excel 2000: How to refer to worksheet in the same book? Jim Excel Worksheet Functions 10 November 14th 05 05:54 PM


All times are GMT +1. The time now is 05:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"