ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how do I let a macro repeat itself in excel (https://www.excelbanter.com/excel-programming/335425-how-do-i-let-macro-repeat-itself-excel.html)

Spil

how do I let a macro repeat itself in excel
 
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31 32 33 34 35
36 37 38 39 40 41 42

I want to have the figures above in 1 vertical column. I can do it by
Transpose them line by line, but is there a macro to automate this process

thanks

Tom Ogilvy

how do I let a macro repeat itself in excel
 
Sub AAA()
Dim i As Long, j As Long, k As Long
Dim v(1 To 42, 1 To 1)
k = 0
For j = 1 To 6
For i = 1 To 7
k = k + 1
v(k, 1) = Cells(j, i)
Next
Next
Range("I1").Resize(42, 1) = v

End Sub

--
Regards,
Tom Ogilvy

"Spil" wrote in message
...
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31 32 33 34 35
36 37 38 39 40 41 42

I want to have the figures above in 1 vertical column. I can do it by
Transpose them line by line, but is there a macro to automate this

process

thanks





All times are GMT +1. The time now is 06:03 AM.

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