How to go to first or last empty row in Excel?
It is time-consuming to scroll and go to the first or last empty row while you are working on a huge worksheet. In this article, I introduce some tricks for quickly going to the first or last empty row in Excel.
Go to first or last empty row with VBA
Go to last empty row or column with Select Last Row utility
Go to first or last empty row with VBA
Here are two VBA can help you quickly go to the first or last empty row in active sheet, please do as below.
1. Press Alt + F11 keys to enable Microsoft Visual Basic for Applications window. See screenshot:
2. Then click Insert > Module and paste below code into the script. See screenshot:
VBA: Go to first blank row.
Sub Findfirstblankcell()
'UpdatebyExtendoffice20170712
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
For Each Rng In WorkRng
If Rng.Value = "" Then
MsgBox "No Value, in " & Rng.Address
End If
Next
End Sub
3. Press F5 to run the code, and a dialog pops out to remind you to choose a range to work. See screenshot:
4. Click OK. A dialog pops out to remind you the cell reference of the first blank row, see screenshot:
5. Click OK repeatedly to close the Microsoft Excel dialog. And then go to the Name box, type A2 into it, press Enter key, and you will go to the first blank row. See screenshot:
Tip: If you want to go to the last empty row, please use below VBA code, and after you press an F5 key, the cursor directly goes to the last blank row.
VBA: Go to last empty row
Sub selectlastemptyrow()
Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Select
End Sub
Note: This VBA will select the last empty cell in the Column A. To select last empty cell in another column, please change 1 in the code Cells(Rows.Count, 1) to another number.
Go to last empty row or column with Select Last Row utility
If you want to go to last empty row or column quickly, you can apply Kutools for Excel’s Last Row or Last Column utility. With them, you can quickly go to the last nonblank cell of last row or column in current worksheet, and then the next cell is the last empty row or empty column.
After installing Kutools for Excel, please do as below:
Click Kutools > Select > Select Last Cell > Last Row/Last Column. See screenshot:
Then the last nonblank cells in the last row (or column) is selected. Just press Down arrow key (or Right arrow key) to activate the last empty row (or column).
Relative Articles
- How to loop through rows until blank in Excel column?
- How to count ignoring zeros or blank cells in Excel?
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!