View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Rosencrantz Rosencrantz is offline
external usenet poster
 
Posts: 7
Default macro to make named ranges

Never mind, I got it to work-I left in lines from my own code in the
code you sent me, so it messed up the ranges. But now, when I call the
macro, the range becomes:

first =
OFFSET(Sheet1!$C:$C,1,0,COUNTA(grnd_results_d1_tex t_file.txt!$C:$C)-1)

Instead of

first = OFFSET(grnd_results_d1_text_file.txt!$C:$8, 1, 0, _
COUNTA(grnd_results_d1_text_file.txt!$C:$C)-1)

So, I'm trying to mess around with it to get it to be the second one.
If you have any ideas of how I can tweak the lines:

With ActiveWorkbook.names
.Add Name:=name1, RefersToR1C1:="=OFFSET(Sheet1!C" & first & _
",1,0,COUNTA(C" & first & ":C" & first & ")-1)"
.Add Name:=name2, RefersToR1C1:="=OFFSET(Sheet1!C" & second & _
",1,0,COUNTA(C" & second & ":C" & second & ")-1)"
End With

I would greatly appreciate it!

~M