Thread: Last record
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Last record

Hi,

If column A is dates you don't need to specifically find the last row you
can get the latest date with

Dim Mydate As Date
Range("F10") = WorksheetFunction.Max(Range("A:A"))

If you want to find the value from the last row you can use

lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Range("F10") = Range("A" & lastrow).Value

Mike


"bijan" wrote:

Hi all,
I connect to a database and receive data, my data is sorted and therefor the
maximum date must be in the last record
1.How can I capture the maximum date that exist in column E ?
2. and how can I put this value in "F10"(at the beginig of the file) and
auto fill it to the end of the file?
Thanks in advance
Bijan