Selecting last row after the row having some data

Raj999

New Member
Joined
Dec 16, 2014
Messages
7
Hi All,

I would like to select a row after the last active row in the excel sheet. for example: imagine I have data till a row say 151 and i would like to select row 152. the number of rows in my worksheet always varies.

Thanks,
Raj
 
Last edited:
If you wish to go last row (A151) of A column where range is A1:151
select cell A1, press "End key" then press "Down Arrow" key
OR
Use vba as under:
Range("A" & Rows.Count).End(xlUp).
 
Upvote 0
Either one of these code lines will do what you want, see the note at the end to decide on which to use..

For last value
---------------
Cells.Find("*", , xlValues, , xlRows, xlPrevious).Offset(1).EntireRow.Select

For last value or formula
------------------------------
Cells.Find("*", , xlFormulas, , xlRows, xlPrevious).Offset(1).EntireRow.Select

A note about those headings... the ones labeled "For last value" means it will return the last used row and column for a displayed value (whether a constant or one from a formula) even if there are formulas after those cells displaying the empty string (""); whereas those labeled "For last value or formula" returns the last cell with either a value or a formula even if that formula is displaying the empty string ("").
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top