YasserKhalil
Well-Known Member
Hello everyone
In my sample I am trying to store the values of specific cells for all the sheets in an array
This is my try .. i can't use redim preserve to preserve previous values
After that I hope to put the results in another sheet like that
1 4 7 10 13 16 19 22 25 28 31 34
2 5 8 11 14 17 20 23 26 29 32 35
3 6 9 12 15 18 21 24 27 30 33 36
Thanks advanced for help
In my sample I am trying to store the values of specific cells for all the sheets in an array
This is my try .. i can't use redim preserve to preserve previous values
Code:
Sub Test()
Dim Arr, Temp
Dim Sh As Worksheet
Dim Counter As Integer
Dim I As Integer
For Each Sh In ThisWorkbook.Worksheets
With Sh
Counter = Counter + 1
Arr = Array(.Range("C6").Value, .Range("E6").Value, .Range("G6").Value)
ReDim Temp(1 To Counter * 3)
For I = Counter To UBound(Temp, 1)
Temp(I) = Arr(I - 1)
Next I
End With
Next Sh
End Sub
After that I hope to put the results in another sheet like that
1 4 7 10 13 16 19 22 25 28 31 34
2 5 8 11 14 17 20 23 26 29 32 35
3 6 9 12 15 18 21 24 27 30 33 36
Thanks advanced for help