#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Last record

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

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
Open new record with selected fields from previous record Design by Sue Excel Discussion (Misc queries) 1 June 12th 09 02:24 PM
Record macro doesn't record shape properties Tosco[_2_] Excel Programming 3 May 30th 07 02:28 AM
Finding last record in month for each of several types of record. Richard Buttrey Excel Programming 5 April 4th 05 02:11 AM
Record Macro - Record custom user actions Sal[_4_] Excel Programming 1 December 23rd 04 03:18 PM
Need help autopopulating next new record with previous record data Harry S[_3_] Excel Programming 2 October 1st 03 10:59 PM


All times are GMT +1. The time now is 04:00 AM.

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

About Us

"It's about Microsoft Excel"