Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe just:
if r is nothing then 'error message here else r.name = "Diagonal" end if Gary''s Student wrote: 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 -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 |