ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy Cells to variant array (https://www.excelbanter.com/excel-programming/358790-copy-cells-variant-array.html)

Jean-Pierre Bidon

Copy Cells to variant array
 
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



Bob Phillips[_6_]

Copy Cells to variant array
 
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)

"Jean-Pierre Bidon" wrote in message
...
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





Jean-Pierre Bidon

Copy Cells to variant array
 
Thanks, this works for me to.

"Bob Phillips" a écrit dans le message
de news: ...
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)

"Jean-Pierre Bidon" wrote in message
...
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








All times are GMT +1. The time now is 01:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com