View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Phrank Phrank is offline
external usenet poster
 
Posts: 153
Default Named Ranges anomaly(?)

Ah, I see what you are talking about and what I did wrong. I'll fix
that. Thank you!!

Frank

On Sat, 16 Apr 2016 01:50:43 -0400, GS wrote:

Firstly, your named ranges are column-absolute, row-relative. This can
result anomolies depending which cell was active when the name was
created.

My practice is to give the the header row a local scope, fully absolute
defined name...

Name: Sheet1!My_Hdr
RefersTo: =Sheet1!$B$1

..so my dynamic range has a 'base point'. Now I can make a dynamic
range as follows...

Name: Sheet1!MyData
RefersTo: =OFFSET(My_Hdr,1,0,COUNTA($B:$B)-1,COLUMN(AO1))

..so the data range begins in row2 because I subtract the header in the
sizing. You could also use a defined name ref for the rightmost column
as follows...

Name: Sheet1!LastCol
RefersTo: =Sheet1!$AO$1

..so your defined name is...

Name: Sheet1!MyData
RefersTo: =OFFSET(My_Hdr,1,0,COUNTA($B:$B)-1,COLUMN(LastCol))