Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, 2021, and Excel in Microsoft 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Selecting the First Cell In a Row.
Written by Allen Wyatt (last updated November 25, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, 2021, and Excel in Microsoft 365
If you need to select the first cell in a row from within your macro, you can do it with the Select method, using either of the following:
Cells(ActiveWindow.RangeSelection.Row, 1).Select ActiveCell.EntireRow.Cells(1).Select
Once executed, the selected cell becomes the first cell (in column A) of the current row. If you run this line while a range of cells is selected, then the cell in column A of the first row of the selection is selected.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (7602) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, 2021, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Selecting the First Cell In a Row.
Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!
The macro programming language used in Excel gives you a great many tools that allow you to modify the way that Excel ...
Discover MoreWhen writing macros, you may want to position a message box at a specific location on the screen. This can't be done in ...
Discover MoreUnprotecting a single worksheet is relatively easy. Unprotecting a whole lot of worksheets is harder. Here's how you can ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2023-11-26 14:39:13
J. Woolley
The Tip's first sentence should be, "If you need to select the first cell in THE ACTIVE CELL'S row from within your macro...."
Here are two more ways:
ActiveWindow.RangeSelection.End(xlToLeft).Select
ActiveCell.End(xlToLeft).Select
The following should be avoided unless you are certain Selection is a Range object and not a graphic object:
Selection.End(xlToLeft).Select
Window.RangeSelection returns the Window's most recently selected Range object. If the most recently selected range has more than one row and its active cell is NOT in the top row, either
ActiveWindow.RangeSelection.End(xlToLeft).Select
or the Tip's
Cells(ActiveWindow.RangeSelection.Row, 1).Select
will select the first cell in its top row, but either
ActiveCell.End(xlToLeft).Select
or the Tip's
ActiveCell.EntireRow.Cells(1).Select
will select the first cell in the active cell's row.
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments