ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   rearranging the data (https://www.excelbanter.com/excel-programming/420815-rearranging-data.html)

Data Rearranging

rearranging the data
 
I have the data with 3000 rows and each row contains 24 values
the format of data is as given
row1 a1 a2 a3,......,a23,a24
row2 b1 b2 b3,.......b23, b24

..
..
..
row3000
i want to rearrange all data in single column as follows
a1
a2
a3
..
..
..
..
a24
b1
b2
b3
..
..
..
b24




filo666

rearranging the data
 
select the data and run:

Sub Transpose()
Dim cnt1 As Integer
Dim arr1() As Variant
cnt1 = 0
For Each cl In Selection.Cells
cnt1 = cnt1 + 1
ReDim Preserve arr1(cnt1)
arr1(cnt1) = cl
Next cl
Selection.ClearContents
For cnt1 = 1 To UBound(arr1)
Cells(cnt1, 1) = arr1(cnt1)
Next
End Sub

"Data Rearranging" wrote:

I have the data with 3000 rows and each row contains 24 values
the format of data is as given
row1 a1 a2 a3,......,a23,a24
row2 b1 b2 b3,.......b23, b24

.
.
.
row3000
i want to rearrange all data in single column as follows
a1
a2
a3
.
.
.
.
a24
b1
b2
b3
.
.
.
b24





All times are GMT +1. The time now is 08:14 AM.

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