Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

naming data ranges

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Naming data ranges

Naming data ranges

ResolvedVersion 2003

Melanie has attended:
Excel Advanced course
Excel VBA Intro Intermediate course

Naming data ranges

Hello,
I am familiar with naming ranges and using these to input into functions, however, if more data is subsequently entered to a worksheet I get frustrated by having to re-set all the ranges again.
Is there something I can do to prevent this from happening in the future?

Many thanks,
Melanie

RE: Naming data ranges

Hi Melanie

Thank you for your question.

If your range spans several rows (for example from rows A1 to A7) and a new item is added in row A8 we can make the range automatically include the new row in the range.

Highlight the values in the column to be included in the range and use Insert > Name > Define and fill in the name box to describe your range e.g. My_Range. Before you click OK in the Refers to section put the following:

=OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),1)

This uses OFFSET and COUNTA functions.
Click OK to complete naming the range.

Now we'll test it. Back in your sheet in a new cell set up a simple function to count how many items there are in your range.

=count(My_Range)
The result in this in this case would be 7

Now add a new item on the next row belowthe values in column A. When you press enter the count should increase by 1 as the new row is included in the range.

I hope this helps - do let us know if you have any further questions.

Kind regards,
Andrew

Tue 9 Feb 2010: Automatically marked as resolved.

Excel tip:

Selecting your working range

In excel if you have an area you want to highlight, press Ctrl + * or Ctrl+Shift+8 (to get the *). This will select your working range.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.