If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Goto last row of the sheet
Hi Expert,
My excel spreadsheet is different days by days. Sometimes, it has 6552 rows. Sometime, it has 7744 rows .... etc ... etc .... Except Control + End + Down .... (VB does not help sometimes, that depend on whether each row is continuous without a break), what is the script in VB that can help me going to last row of the spreadsheet please ? Thanks in advance... |
#2
|
|||
|
|||
Goto last row of the sheet
Hi,
The last used row can be found with lastrow = Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row to select column A of that row use Range("A" & Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row).Select Mike "Elton Law" wrote: Hi Expert, My excel spreadsheet is different days by days. Sometimes, it has 6552 rows. Sometime, it has 7744 rows .... etc ... etc .... Except Control + End + Down .... (VB does not help sometimes, that depend on whether each row is continuous without a break), what is the script in VB that can help me going to last row of the spreadsheet please ? Thanks in advance... |
#3
|
|||
|
|||
Goto last row of the sheet
Sub range_reporter()
Dim r As Range Dim nLastRow As Long Set r = ActiveSheet.UsedRange nLastRow = r.Rows.Count + r.Row - 1 Cells(nLastRow, 1).Select End Sub -- Gary''s Student - gsnu200845 "Elton Law" wrote: Hi Expert, My excel spreadsheet is different days by days. Sometimes, it has 6552 rows. Sometime, it has 7744 rows .... etc ... etc .... Except Control + End + Down .... (VB does not help sometimes, that depend on whether each row is continuous without a break), what is the script in VB that can help me going to last row of the spreadsheet please ? Thanks in advance... |
#4
|
|||
|
|||
Goto last row of the sheet
lr = Cells.Find("*", Cells(Rows.Count, Columns.Count) _
, , , xlByRows, xlPrevious).Row -- Don Guillett Microsoft MVP Excel SalesAid Software "Elton Law" wrote in message ... Hi Expert, My excel spreadsheet is different days by days. Sometimes, it has 6552 rows. Sometime, it has 7744 rows .... etc ... etc .... Except Control + End + Down .... (VB does not help sometimes, that depend on whether each row is continuous without a break), what is the script in VB that can help me going to last row of the spreadsheet please ? Thanks in advance... |
Thread Tools | |
Display Modes | |
|
|