Hi,
I have speed complaint about populate the cell values to the 2D arrays. I copied a part of VBA code to here.
Please suggest a speedy code.
Thanks in advance.
VBA CODE
------------------------------------------------
Public List(11, 5), dimsayi As Integer
Public Sub Test()
-------------------------------------------------
sayi = [B1]: dimsayi = 0
For n = 4 To sayi * 4 Step 4
dimsayi = dimsayi + 1
List(dimsayi, 1) = 2: List(dimsayi, 2) = Cells(n, 1): List(dimsayi, 3) = Cells(n + 1, 1): List(dimsayi, 4) = Cells(n + 2, 1): List(dimsayi, 5) = Cells(n + 3, 1)
Next n
End Sub
--------------------------------------------------
B1 formula = (C1-3)/4
C1 formula =MATCH("TOTAL";A1:A400;0)-1
17719
PART1
1
PCS
17720
PART2
1
PCS
17722
PART3
1
PCS
17726
PART4
1
PCS
35147
PART5
1
PCS
53860
PART6
2
PCS
53925
PART7
4
PCS
6403055E
PART8
1
PCS
68631
PART9
0,1
PCS
68733
PART10
0,00833
PCS
74147
PART11
2
PCS
TOTAL
I have speed complaint about populate the cell values to the 2D arrays. I copied a part of VBA code to here.
Please suggest a speedy code.
Thanks in advance.
VBA CODE
------------------------------------------------
Public List(11, 5), dimsayi As Integer
Public Sub Test()
-------------------------------------------------
sayi = [B1]: dimsayi = 0
For n = 4 To sayi * 4 Step 4
dimsayi = dimsayi + 1
List(dimsayi, 1) = 2: List(dimsayi, 2) = Cells(n, 1): List(dimsayi, 3) = Cells(n + 1, 1): List(dimsayi, 4) = Cells(n + 2, 1): List(dimsayi, 5) = Cells(n + 3, 1)
Next n
End Sub
--------------------------------------------------
B1 formula = (C1-3)/4
C1 formula =MATCH("TOTAL";A1:A400;0)-1
17719
PART1
1
PCS
17720
PART2
1
PCS
17722
PART3
1
PCS
17726
PART4
1
PCS
35147
PART5
1
PCS
53860
PART6
2
PCS
53925
PART7
4
PCS
6403055E
PART8
1
PCS
68631
PART9
0,1
PCS
68733
PART10
0,00833
PCS
74147
PART11
2
PCS
TOTAL