VB: using a string to set a range object?

  • Thread starter Thread starter RGK
  • Start date Start date
R

RGK

I'm a bit new to the excel "range" object type. I was suprised to see that
while I can do:

dim chunk as Range
chunk = .Range(A5:B6)

I apparently cannot do:

dim chunk as Range
dim stuff as string
string = "A5:B6"
chunk= .Range(string)

How can I concatenate up a string describing a range, and then use it to
define a range object's target cells?


- Ross.
 
Objects have to be set.

Variables are referred to by the name not the type.

Dim chunk As Range
Dim stuff As String

stuff = "A5:B6"
Set chunk = Range(stuff)


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Back
Top