Solved

Dynamic named range changes with insert

Posted on 2010-11-08
5
284 Views
Last Modified: 2012-05-10
I have a dynamic named range defined like this:

=Inmatning!$A$3:INDEX(Inmatning!$A:$A;MATCH(BigText;Inmatning!$A:$A))

My problem is when I want to insert a row in the range with this code

Rows("3:3").Insert Shift:=xlDown

the definition of the named range changes to

=Inmatning!$A$4:INDEX(Inmatning!$A:$A;MATCH(BigText;Inmatning!$A:$A))

I need the named range definition to NOT change. How can I solve this?

Thanks,

/peter
0
Comment
Question by:pivar
  • 2
  • 2
5 Comments
 
LVL 50

Accepted Solution

by:
teylyn earned 500 total points
ID: 34082553
Hello, you could use=Index(Inmatning!$A:$A,3):INDEX(Inmatning!$A:$A;MATCH(BigText;Inmatning!$A:$A))cheers, teylyn
0
 
LVL 11

Expert Comment

by:jkpieterse
ID: 34082906
Just a remark on your MATCH function: You do know that -since you omitted the third argument- the match does not necessarily return exact matches?
0
 
LVL 50

Expert Comment

by:teylyn
ID: 34082918
@JKP,

in this case, the exact match is not required. The purpose of the last Index/Match is to return the last populated cell, hence BigText. Omitting the third argument will default it to 1, which is exactly what the formula should be.

I agree, though, that it's always better to state the argument than to omit it.

cheers, teylyn
0
 
LVL 22

Author Comment

by:pivar
ID: 34082926
jkpieterse:
I'm using this definition to find the last used row. BigText is =REPT("ö";50)
0
 
LVL 22

Author Closing Comment

by:pivar
ID: 34082936
Thanks, that solved it.

/peter
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now