Name range example

  • Thread starter Thread starter excelnut1954
  • Start date Start date
E

excelnut1954

I know this will work to name a range for a single column.

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

But, how would you adapt it to include the next 3 columns to the
right?

Thanks,
J.O.
 
Use Resize:

Range(Selection, Selection.End(xlDown)).Resize(,3).Name = "Test"

for a total of 3 columns. Change the 3 to a 4 if it is 3 additional columns.
 
Range(Selection.Resize(1, 3), Selection.End(xlDown)).Name = "Test"


"Tom Ogilvy" skrev:
 

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