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: Displaying the Selected Cell's Address.
Written by Allen Wyatt (last updated January 14, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021
Excel allows you to easily see the location of the currently selected cell by examining the contents of the Name Box, to the left of the Formula Bar. This is fine and good, but there are times when you would like to have the address of a cell actually in a cell. For instance, you may want cell A1 to contain the address of the currently selected cell. This means that if cell E4 were selected, then A1 would contain its address, or $E$4. If you then pressed the right-arrow key, then the contents of A1 would change to $F$4.
You can grab the address of the currently selected cell by using the CELL worksheet function, in this manner:
=CELL("Address")
You should note that this function doesn't result in the contents of the cell changing every time you move to a different cell. Instead, the function is updated only when the workbook is recalculated, either by changing something in the worksheet or by pressing F9.
If, instead, you need to have "real time" reporting of the selected cell, you'll need to resort to using a macro. Follow these steps:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) Range("A1").Value = ActiveCell.Address End Sub
Now, as you move about this single worksheet, the contents of A1 should be constantly updated to reflect your location.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12400) 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: Displaying the Selected Cell's Address.
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!
Macros are very powerful, but you may not want them to always be available to a user. Here are some ways you can limit ...
Discover MoreNormally Excel positions a UserForm in the center of your screen. You may want to position the form elsewhere, more ...
Discover MoreExcel allows you to define names that can refer either to ranges of cells or to constant information, such as formulas. ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2023-01-14 10:55:49
J. Woolley
When this Tip refers to the "selected" cell it means the "active" cell. A Selection can have more than one cell, but only one of those cells is Active. When using the mouse, the Active cell is usually the first cell selected in the last selected contiguous range of cells. You can identify the Active cell by borders and shading. It is interesting to use this Tip's formula or macro to review the difference between "selected" and "active" cells.
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 © 2024 Sharon Parq Associates, Inc.
Comments