crc234
07-29-2015, 03:52 PM
Hi there!
I'm new to VBA and am trying to figure out how to make transposing more efficient. I have a sample data set below that I need to transpose (to sheet 2) every 4th row on the first column into a single row, and when that hits an empty cell I need it to loop to the next column, do the same, until it hits an empty column. The issue is this data can get quite long both horizontally and vertically.
I really appreciate if anyone can help out! Thank you so much!
Original Data:
PKO
SJL
PKO
SJL
0.512
0.41
145
85.4
0.47
0.514
158
93.6
0.377
0.51
135
92.5
0.492
0.521
142
98.9
2.99
1.57
180
110
2.56
1.82
181
110
1.84
1.7
146
111
2.01
1.8
151
113
Expected result:
PKO
0.512
0.47
0.377
0.492
2.99
2.56
1.84
2.01
SJL
0.41
0.514
0.51
0.521
1.57
1.82
1.7
1.8
PKO
145
158
135
142
180
181
146
151
SJL
85.4
93.6
92.5
98.9
110
110
111
113
I'm new to VBA and am trying to figure out how to make transposing more efficient. I have a sample data set below that I need to transpose (to sheet 2) every 4th row on the first column into a single row, and when that hits an empty cell I need it to loop to the next column, do the same, until it hits an empty column. The issue is this data can get quite long both horizontally and vertically.
I really appreciate if anyone can help out! Thank you so much!
Original Data:
PKO
SJL
PKO
SJL
0.512
0.41
145
85.4
0.47
0.514
158
93.6
0.377
0.51
135
92.5
0.492
0.521
142
98.9
2.99
1.57
180
110
2.56
1.82
181
110
1.84
1.7
146
111
2.01
1.8
151
113
Expected result:
PKO
0.512
0.47
0.377
0.492
2.99
2.56
1.84
2.01
SJL
0.41
0.514
0.51
0.521
1.57
1.82
1.7
1.8
PKO
145
158
135
142
180
181
146
151
SJL
85.4
93.6
92.5
98.9
110
110
111
113