select the next row after the last existing row (VBA)

abadilala

New Member
Joined
Sep 29, 2017
Messages
27
Hi, I want to select the next row after the last existing row. For example I have existing data with 2000 row. what I want to do is to select the row number 2001. However, I don't want to use Range A:2001.
Is there any way to do it using macro excel?
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Try

Code:
Sub MM1()
Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).EntireRow.Select
End Sub
 
Upvote 0
Hi, I want to select the next row after the last existing row. For example I have existing data with 2000 row. what I want to do is to select the row number 2001. However, I don't want to use Range A:2001.
Is there any way to do it using macro excel?
I am assuming by the highlighted text above that you mean there is not particular column that is guaranteed to always contain the last piece of data. If I am wrong, then use what Michael suggested in Message #2 . But if I am correct, then use this macro instead...
Code:
Sub RowPastLastDataRow()
  Cells.Find("*", , xlValues, , xlRows, xlPrevious).Offset(1).EntireRow.Select
End Sub
 
Upvote 0
Yes Rick, your assumption was right.
I tried to use your code below, and want to paste the selection data into the row. but not works.

Cells.Find("*", , xlValues, , xlRows, xlPrevious).Offset(1).EntireRow.Select
Selection.Paste

I saw the problem was because it select all the row. What I want to select is column A only, then paste the selected data.
 
Last edited:
Upvote 0
I saw the problem was because it select all the row. What I want to select is column A only, then paste the selected data.
The reason I selected the entire row is because I thought that is what you meant when you said "what I want to do is to select the row number 2001". This should do what you are asking for...

Cells(Cells.Find("*", , xlValues, , xlRows, xlPrevious).Offset(1).Row, "A").Select
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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