create a global name that refers to a range using the Add method of the Workbook object's Names collection : Name Create « Excel « VBA / Excel / Access / Word






create a global name that refers to a range using the Add method of the Workbook object's Names collection

 
Sub add()
     Names.add name:="Data", RefersTo:="=Sheet1!$D$10:$D$12"
End Sub

 








Related examples in the same category

1.Create a local name
2.renames an existing name:
3.Create a name based on a Range
4.Add the name to the Names collection associated with the worksheet, which only includes the names that are local to that worksheet
5.Define a name by referring a workbook
6.Define a name by referring the selection cell address