ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   loop to add data in array (https://www.excelbanter.com/excel-programming/394751-loop-add-data-array.html)

Tom Ogilvy

loop to add data in array
 
There is no support for that and since there isn't I would wonder why you
would want to do that

you can do an array of arrays

Sub AABB()
Dim wArray1, wArray
Dim i as long, j as long, k as long
ReDim wArray1(1 To 100)
ReDim wArray(1 To 100)
k = 0
For i = 1 To 100 Step 10
For j = 1 To 10
k = k + 1
wArray(k) = Application.Transpose(Cells(i, j).Resize(10, 1))
wArray1(k) = Cells(i, j).Resize(10, 1).Address
Debug.Print k, Cells(i, j).Resize(10, 1).Address
Next
Next

MsgBox wArray(3)(5)
End Sub

--
Regards,
Tom Ogilvy


"PST" wrote:

Hello

That is to say a table of 100 rows and 10 colums
A1:J100 With a loop I would like that:

line A1:A10 becomes W_1 array
the line b1:b10 becomes W_2 array
the line c1:c10 becomes W_3 array

etc for all the lines, with the corresponding data of each line


Thank you


Alan Beban

loop to add data in array
 
PST wrote:
Hello

That is to say a table of 100 rows and 10 colums
A1:J100 With a loop I would like that:

line A1:A10 becomes W_1 array
the line b1:b10 becomes W_2 array
the line c1:c10 becomes W_3 array

etc for all the lines, with the corresponding data of each line


Thank you


I'm afraid I can't see what "etc" means. Is there a W_11 array?

Alan Beban

PST

loop to add data in array
 
Hello

That is to say a table of 100 rows and 10 colums
A1:J100 With a loop I would like that:

line A1:A10 becomes W_1 array
the line b1:b10 becomes W_2 array
the line c1:c10 becomes W_3 array

etc for all the lines, with the corresponding data of each line


Thank you


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

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