Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. 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.

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, Excel in Microsoft 365, and 2021


1

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:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (7602) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Excel here: Selecting the First Cell In a Row.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Searching for Periods Not Followed by a Space

Most periods should be followed by at least one space. What if you think there may be some errors in how your post-period ...

Discover More

Keeping with British English

Getting languages to work correctly in Word can be a challenge at times. In this tip you'll find some ideas for how to ...

Discover More

Changing the Comment Font

When you add a comment to a worksheet, Excel uses a default font and size for the text. If you want to make changes to ...

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

More ExcelTips (ribbon)

Tools on Developer Tab are Unavailable

Want to add some macros to your workbook? What do you do if you try to add the macros but the program has disabled the tools?

Discover More

Relative VBA Selections

Need to select a cell using a macro? Need that selection to be relative to the cell you currently have selected? Here are ...

Discover More

Creating Dependent Cells

Making the values in two cells mirror each other may seem like a desirable thing to do. It can be done, as discussed in ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is two less than 9?

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.


This Site

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.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.