Hi,
See
Code:
Sub kTest()
Dim ka, k(), i As Long, c As Long, n As Long
ka = Range("a1:be6").Value '<<<< adjust this
ReDim k(1 To UBound(ka, 2) * UBound(ka, 1), 1 To 10) 'adjust the '10'
For i = 3 To UBound(ka, 1)
For c = 8 To UBound(ka, 2) 'start from 8th column
n = n + 1
k(n, 1) = ka(i, 1) 'desc
k(n, 2) = ka(i, 2) 'test1
k(n, 3) = ka(i, 3) 'test2
k(n, 4) = ka(i, 4) 'test3
k(n, 5) = ka(i, 5) 'test4
k(n, 6) = ka(i, 6) 'test5
k(n, 7) = ka(i, 7) 'test6
k(n, 8) = ka(1, c) 'bud/act
k(n, 9) = ka(2, c) 'period
k(n, 10) = ka(i, c) 'value
Next
Next
With Sheets("Sheet2")
.Range("a1:j1") = Array("Description", "", "", "", "", "", "", "Bud/Act", "Period", "Value")
.Range("a2").Resize(n, UBound(k, 2)) = k
End With
End Sub
Bookmarks