Syntax - Add Range Name based on Selection

  • Thread starter Thread starter Bruce Roberson
  • Start date Start date
B

Bruce Roberson

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
 
Looks like I tried to make it harder than it was. I
actually kept fiddling with the syntax till I got it to
work, but I definitely like your way much better. So I
made that change.

Thanks,


Bruce Roberson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top