Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Please send me an example code to get the last record number in a worksheet |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
MsgBVox Cells(LastRow,LastCol).Value
'----------------------------------------------------------------- Function LastRow() As Long '----------------------------------------------------------------- LastRow = Cells.Find(What:="*", _ After:=Range("A1"), _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row End Function '----------------------------------------------------------------- Function LastCol() As Long '----------------------------------------------------------------- LastCol = Cells.Find(What:="*", _ After:=Range("A1"), _ SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious).Column End Function -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Raj" wrote in message ... Hi Please send me an example code to get the last record number in a worksheet |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to find and record Unique values? | Excel Discussion (Misc queries) | |||
Why doesn't Excel 2007 record charting and office art macro code? | Excel Discussion (Misc queries) | |||
find last record in macro and delete all after | Excel Programming | |||
find last record in macro and delete all after | Excel Discussion (Misc queries) | |||
vba code to record a macro | Excel Programming |