Autoname a range

  • Thread starter Thread starter CLB
  • Start date Start date
C

CLB

Thanks in advance.

Is it possible to automate the naming of a range, say of a table, as say the
intersection of the row and column headers?
 
Hi
Try this

ActiveWorkbook.Names.Add Name:=Selection.Cells(1, 1).Text,
RefersTo:=Selection.Address

The row and column headers are assumed to be in the first row and
column (the Cells(1,1) bit). You can replace Selection with a range
object if you require.

regards
Paul
 
Assume the variable rng points at the table

rng.Name = rng.Cells(1,1,).value
 

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