Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assign a Name to a Range in VBA
I would like to be able to assign a name to a range in VBA. For example:
Sub mac2() Dim r As Range Set r = Cells(1, 1) For i = 2 To 10 If Not IsEmpty(Cells(i, i).Value) Then Set r = Union(r, Cells(i, i)) End If Next r.Select ActiveWorkbook.Names.Add Name:="diagonal", RefersToR1C1:= ????????? End Sub By Naming a range I can make it available to worksheet functions. -- Gary''s Student |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Assign a code to a range of time | Excel Worksheet Functions | |||
How do I assign range to variant and use | Excel Discussion (Misc queries) | |||
assign value to range in VBA function | Excel Programming | |||
assign a value to a range | Excel Discussion (Misc queries) | |||
Assign Range - Inactive Worksheet | Excel Programming |