I think this will partially answer your question.
All I can say is that all objects must be Set to call any type of method on them. These are the basics of the OOP concept. You can have an object of any type, for example,
Dim obj as Range
Dim obj as Application
Dim obj as Long
but actually itβs just a reserved room in memory for this variable and is waiting for the link to be assigned.
Therefore, the simple answer is: No, it is not possible to set an empty range object.
Check it out for yourself:
Sub RangeTest() Dim rng As Range 'Set rng = Range("A1") ActiveWorkbook.Names.Add Name:="rngName", RefersTo:=rng.Address MsgBox "count: " & rng.Cells.Count End Sub
obviously this is higher however
Sub RangeTest() Dim rng As Range Set rng = Range("A1") ActiveWorkbook.Names.Add Name:="rngName", RefersTo:=rng.Address MsgBox "count: " & rng.Cells.Count End Sub
also
Range 2010 Object Developer's Guide Excel clearly states
A Range object represents one or more cells and can be used to represent one cell, a row, a column, a selection of cells that contain one or more adjacent blocks of cells, or a three-dimensional range.
user2140173
source share