View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
GS[_6_] GS[_6_] is offline
external usenet poster
 
Posts: 1,182
Default Named Ranges anomaly(?)

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))

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion