View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default Trouble getting used to VBA

If you want to create an Excel name for a range (the same as Define Name):

Range(Selection, Selection.End(xlDown)).Name = "MyName"

If you want to create a range object variable for a range in VB:

Set INS = Range(Selection, Selection.End(xlDown))


--
Jim Rech
Excel MVP
"JF" wrote in message
...
|I am new to Visual basic and have made only a few
| applications i was wondering if someone knew how to name a
| range as a variable. The bottom part is where im having
| the issue
|
|
| Thanks
|
| Jeff
|
| Dim INS As Range
|
| ActiveCell.Offset(0, 2).Select
| Range(Selection, Selection.End(xlDown)).Select
|
| ' Trying to name the following range
| INS = activeRange.Select
|
| End Sub
|
|