View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Range object evaluates to Range.value, or Range object

Paul,

You need to use Set:

Dim objRange As Range
Set objRange = Range("A1")
Msgbox objRange.Address & " is " & objRange.Value

HTH,
Bernie
MS Excel MVP


wrote in message
...
In most equations, when a Range object shows up in an expression on
the right hand side of the assignment operator "=", the range object's
value is used. I'm interested in assigning a range object to a
variable that has been dim'd as type Range.

Where can one find the rules that govern what objects evaluate to when
they show up in expressions?

Also, in many cases, things like Range are used in the documentation
to describe a Range object as well as a collection of range objects.
Where in the documentation does it describe how the word Range is
interpretted in (say) a Dim statement? What about rules governing
whether a collection is returned in evaluating an expression, or
whether a default object within the collection is returned?

Thanks. (I'm using Office 2003)