View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Martin Fishlock Martin Fishlock is offline
external usenet poster
 
Posts: 694
Default macro code to find last record in excel

Raj:

What do you mean by the last record number.

Excel is not a database is it a spreadsheet.

If you mean the last row in the speadsheet then:

activesheet.cells.rows.count

if you mean the last row with some entry on it then:

activesheet.usedrange.row + activesheet.usedrange.rows.count - 1

--

Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Raj" wrote:

Hi
Please send me an example code to get the last record number in a worksheet