ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Creating Range Names (https://www.excelbanter.com/excel-programming/289127-creating-range-names.html)

TroyH

Creating Range Names
 
Can I create a range name based on the value of a cell?

Rob van Gelder[_4_]

Creating Range Names
 
TroyH,

Sure can!

Sub test()
ActiveWorkbook.Names.Add _
Name:=Range("A2").Value, _
RefersTo:="=Sheet1!$A$1:$D$3"
End Sub


Rob

"TroyH" wrote in message
...
Can I create a range name based on the value of a cell?




JE McGimpsey[_2_]

Creating Range Names
 
One way:

Range("A1:J10").Name = Range("K1").Value

In article ,
"TroyH" wrote:

Can I create a range name based on the value of a cell?



All times are GMT +1. The time now is 01:47 PM.

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