Named Ranges

You can name a range or area of the grid, and then refer to it in formulae or user code. This can improve the readability and maintainability of your workbook.

How name a range

  1. Select a range in the grid.

  2. Select Data, Edit names.

    A popup window lists the names that have been defined so far, with buttons to add new ones and delete existing ones.

  3. Click Add.

    A new line appears in the list.

  4. Enter a name. This must be different from a cell reference, e.g. you can't call a range something like 'A1'.

  5. If required, adjust the reference to the range. The reference must be absolute.

  6. Click OK to apply the name and close the window.

How to use named ranges

In formulae

For greater readability and maintainability, use range names instead of explicit cell references.

For example, instead of writing =SUM(A12:Z12), write =SUM(monthlySales).

In user code

Range names are a way to define a variable referencing a CellRange. The variable is global, and is defined in the "Constants and Formatting" section of the code.

Comments