Copy Cells to variant array

J

Jean-Pierre Bidon

Hie,
I think this question is rather banal but I'm stucked on it.
I would like to copy a range (or a collection of cells) in a variant array.
Using this syntax doesn't work:
---> vaRst = rgCurr(Cells(2, 1), Cells(iRow, iCol))
Need help.
Thanks.

Jean-Pierre Bidon
 
B

Bob Phillips

This works for me

Dim rgCurr As Range
Dim vaRst
Dim iRow As Long, iCol As Long

iRow = 3: iCol = 6
Set rgCurr = Range("A1:H10")
vaRst = rgCurr.Cells(2, 1).Resize(iRow - 1, iCol)

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
J

Jean-Pierre Bidon

Thanks, this works for me to.

Bob Phillips said:
This works for me

Dim rgCurr As Range
Dim vaRst
Dim iRow As Long, iCol As Long

iRow = 3: iCol = 6
Set rgCurr = Range("A1:H10")
vaRst = rgCurr.Cells(2, 1).Resize(iRow - 1, iCol)

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top