?
Solved

Dynamic named range changes with insert

Posted on 2010-11-08
5
Medium Priority
?
296 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:
Ingeborg Hawighorst (Microsoft MVP / EE MVE) earned 2000 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
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

864 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