named range changed when I inserted a row

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,514
Hi

I named A1:A10 as myrange1. Then I inserted a empty row between row 2 and 3. To my surprised now myrange1 is actually A1:A11 ?

Is that by design? if yes, then what is the point of naming range when I can not grante, it will point to the cells I want. Thank you
 

offthelip

Well-known Member
Joined
Dec 23, 2017
Messages
1,004
It is by design and it is very useful because of it, this is because it allows you to add data to a worksheet and all the equations work without needing to change them all. This behaviour happens whether it is a named range or not. If you have an equation such as :
=Sum(A1:A10)
then if you insert a row e.g. at row 3 you will find the equation has changed to:
=Sum(A1:A11)
 
Last edited:

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
51,444
Office Version
365
Platform
Windows
Using named ranges often makes things like formula easier to work with, especially if you are copying, autofilling, or dragging the formulas, and don't want the range references to change as you do that (I use them mostly when I am doing VLOOKUP and returning multiple columns, so have multiple formulas that I want to copy).

However, just like any other range reference, if you insert or delete a row within that range, the range will automatically grow/shrink to reflect. In most cases, this is what you want to happen.
I cannot think of too many instances where I have a named range, and I adjust the number of rows contained within that range, and not want my named range to reflect that change. Most of the time, it would cause issues for me if that range size did NOT change.
 

Forum statistics

Threads
1,081,795
Messages
5,361,333
Members
400,627
Latest member
Mcomeaux

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top