View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Syntax - Add Range Name based on Selection

Range(Selection, Selection.End(xlDown)).Name = "AREA1"

--
Regards,
Tom Ogilvy

"Bruce Roberson" wrote in message
...
What is the proper syntax for adding the name "Area1" in
this case, based on a selection of the active cell,
xldown. I recorded it but of course it recorded actual
R1C1 of the range at the time. That doesn't work since the
range will vary in size each time it is run.

So, I need to go something like this.

ActiveWorkbook.Names.Add Name:="AREA1" _
Range.(Selection, Selection.End(xlDown))

Thanks,


Bruce