Assign a descriptive name to a cell or range in Excel 2010 to help make formulas in your worksheets much easier to understand and maintain. Range names make it easier for you to remember the purpose of a formula, rather than using obscure cell references.
For example, the formula =SUM(Qtr2Sales) is much more intuitive than =SUM(C5:C12). In this example, you would assign the name Qtr2Sales to the range C5:C12 in the worksheet.
Naming cells
Although you can create names that override Excel's internal names, you should avoid doing so. To be on the safe side, avoid using the following names: PrintArea, PrintTitles, ConsolidateArea, and SheetTitle. Create a named range in Excel. To create a named range, start by selecting the cell or range that you want to assign a name. There is no special button for the Name Manager in any version of Excel for Mac. However, you can call it by pressing ⌘ + fn + F3. The dialog window will appear, where you can enter name for a data range and a range of cells: Another way is to click InsertNameDefine and modify,add,or delete data ranges names.
Excel Range Names In Formulas
To name a cell or range, follow these steps:
- Select the cell or cell range that you want to name.You also can select noncontiguous cells (press Ctrl as you select each cell or range).
- On the Formulas tab, click Define Name in the Defined Names group.The New Name dialog box appears.Use the New Name dialog box to assign a name to the selected range.
- In the Name text box, type up to a 255-character name for the range.Range names are not case-sensitive; however, range names must follow these conventions:
- The first character must be a letter, an underscore, or a backslash.
- No spaces are allowed in a range name.
- The range name should not be the same as a cell address. For example, you can’t name a range U2 or UB40, but BLINK182 and ABBA are just fine.
- Click OK.
Alternatively, you can enter a range name into the Name box located at the left end of the Formula bar and press Enter to create the name.
Using a named range
To use a named cell or range, click the down arrow in the Name box at the left end of the Formula bar. Select the range name you want to access, and Excel highlights the named cells.
Set Print Range Names In Excel
You can select a range name in the Name box to quickly locate an area of a worksheet.
You also can use range names with the Go To dialog box, to make it easier to locate specific areas of a worksheet. Press F5 to display the Go To dialog box, select the range name you want to jump to, and click OK.
You can insert range names into formulas just like they were normal cell references. Be careful using named multi-cell ranges, though. Remember to use functions that require a range instead of a single cell reference — such as MAX, SUM, or AVERAGE — or else you’ll get an error message.
Did this glimpse into Excel data management leave you longing for more information and insight about Microsoft’s popular spreadsheet program? You’re free to test drive any of the For Dummies eLearning courses. Pick your course (you may be interested in more from Excel 2010), fill out a quick registration, and then give eLearning a spin with the Try It! button. You’ll be right on course for more trusted know how: The full version’s also available at Excel 2010.
-->Ranges are easier to identify by name than by A1 notation. To name a selected range, click the name box at the left end of the formula bar, type a name, and then press ENTER.
Note There are two types of named ranges: Workbook Named Range and WorkSHEET Specific Named Range.
Workbook Named Range
A Workbook Named Range references a specific range from anywhere in the workbook (it applies globally).
How to Create a Workbook Named Range:
As explained above, it is usually created entering the name into the name box to the left end of the formula bar. Note that no spaces are allowed in the name.
WorkSHEET Specific Named Range
A WorkSHEET Specific Named Range refers to a range in a specific worksheet, and it is not global to all worksheets within a workbook. You can refer to this named range by just the name in the same worksheet, but from another worksheet you must use the worksheet name including '!' the name of the range (example: the range 'Name' '=Sheet1!Name').
The benefit is that you can use VBA code to generate new sheets with the same names for the same ranges within those sheets without getting an error saying that the name is already taken.
How to Create a WorkSHEET Specific Named Range:
- Select the range you want to name.
- Click on the 'Formulas' tab on the Excel Ribbon at the top of the window.
- Click 'Define Name' button in the Formula tab.
- In the 'New Name' dialogue box, under the field 'Scope' choose the specific worksheet that the range you want to define is located (i.e. 'Sheet1')- This makes the name specific to this worksheet. If you choose 'Workbook' then it will be a WorkBOOK name).
Example, of WorkSHEET Specific Named Range: Selected range to name are A1:A10
Chosen name of range is 'name' within the same worksheet refer to the named name mere by entering the following in a cell '=name', from a different worksheet refer to the worksheet specific range by included the worksheet name in a cell '=Sheet1!name'.
Referring to a Named Range
The following example refers to the range named 'MyRange' in the workbook named 'MyBook.xls.'
The following example refers to the worksheet-specific range named 'Sheet1!Sales' in the workbook named 'Report.xls.'
To select a named range, use the GoTo method, which activates the workbook and the worksheet and then selects the range.
Microsoft Excel For Mac
The following example shows how the same procedure would be written for the active workbook.
Sample code provided by: Dennis Wallentin, VSTO & .NET & Excel
This example uses a named range as the formula for data validation. This example requires the validation data to be on Sheet 2 in the range A2:A100. This validation data is used to validate data entered on Sheet 1 in the range D2:D10.
Looping Through Cells in a Named Range
Mamp pro local web development 5 5. The following example loops through each cell in a named range by using a For Each..Next loop. If the value of any cell in the range exceeds the value of
Limit
, the cell color is changed to yellow.About the Contributor
Dennis Wallentin is the author of VSTO & .NET & Excel, a blog that focuses on .NET Framework solutions for Excel and Excel Services. Dennis has been developing Excel solutions for over 20 years and is also the coauthor of 'Professional Excel Development: The Definitive Guide to Developing Applications Using Microsoft Excel, VBA and .NET (2nd Edition).'
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.