ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Autoname a range (https://www.excelbanter.com/excel-programming/417464-autoname-range.html)

CLB

Autoname a range
 
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?


[email protected]

Autoname a range
 
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

On Sep 23, 7:25*am, CLB wrote:
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?



Bob Phillips[_3_]

Autoname a range
 
Assume the variable rng points at the table

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

--
__________________________________
HTH

Bob

"CLB" wrote in message
...
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?





All times are GMT +1. The time now is 02:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com