View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default non r1c1 name definition

try
ActiveWorkbook.Names.Add Name:="Datalist", RefersTo:= _
"=OFFSET(Sheet2!$A$1,0,0,COUNTA(Sheet2!A:A)+1, 7)"



--
Don Guillett
SalesAid Software

"BorisS" wrote in message
...
I'm using 07, in case that's relevant in the below.

I am having trouble making my macro name a range at each run. Tried
recording the steps I took to get a range named as follows:

=OFFSET(Sheet2!$A$1,0,0,COUNTA(Sheet2!A:A)+1,7). The range is called
Datalist, and is later used in my filters.

Auto recording is coming up with this:

ActiveWorkbook.Names.Add Name:="Datalist", RefersToR1C1:= _
"=OFFSET(Sheet2!R1C1,0,0,COUNTA(Sheet2!C)+1,7) "

which is not producing the same thing in the name manager. Once this is
run
and assigned, it is coming up with inconsistent column references for the
CountA function, and I don't know to what to attribute this.

Thanks for any clarification.


--
Boris