naming data ranges

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

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

Naming data ranges

resolvedResolved · Low Priority · Version 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:

Recently used file list

Under the File menu, you may find a list of files at the bottom of the menu. These files represent the most recently used Excel spreadsheets. This file list provides a quick way for you to access your files.

You can disable the file list feature of Excel. This is done by

1. Choose Tools > Options menu. You will see the Options dialog box.
2. Ensure the General tab is selected.
3. Make sure the Recently Used File List check box is cleared.
4. Click on OK.

View all Excel hints and tips


Server loaded in 0.08 secs.