sukumar.vb
02-23-2009, 05:07 PM
Hi all,
I am looking for a VBA Code to convert my 30 data in columns to fit into a single row. There is a English term for this. I can't recall that term. But, thanz to you, if you can tell me VBA code to convert data from Cols to fit into rows. May be you can use for next loop or Do while loop. Anything working. I am just looking for an idea.
Is there any VBA code for following:-
Problem:
Transposing the values in List1 (cells A2:A5) into a row, and the values in List2 (cells B10:F10) into a column.
Solution 1: To transpose from a Column into a Row.
To transpose the values in Column A (List1) into a Row:
Using the INDEX and COLUMN functions, enter the following formula in cell C2, and then copy it across the next 3 cells in the row:
=INDEX($A$2:$A$5,COLUMN()-COLUMN($C$2)+1)
Alternative solution:
Select cells C2:F2 and enter the TRANSPOSE function as shown in the following Array formula:
{=TRANSPOSE(A2:A5)}
Solution 2: To transpose from a Row into a Column.
To transpose the values in Row 10 (List2) into a Column:
Using the INDEX and ROW functions, enter the following formula in cell H10, and then copy it down to the next 4 cells in the column:
=INDEX($B$10:$F$10,ROW()-ROW($H$10)+1)
Alternative solution:
Select cells H10:H14 and enter the TRANSPOSE function as shown in the following Array formula:
{=TRANSPOSE(B10:F10)}
Thanz
Sukumar
I am looking for a VBA Code to convert my 30 data in columns to fit into a single row. There is a English term for this. I can't recall that term. But, thanz to you, if you can tell me VBA code to convert data from Cols to fit into rows. May be you can use for next loop or Do while loop. Anything working. I am just looking for an idea.
Is there any VBA code for following:-
Problem:
Transposing the values in List1 (cells A2:A5) into a row, and the values in List2 (cells B10:F10) into a column.
Solution 1: To transpose from a Column into a Row.
To transpose the values in Column A (List1) into a Row:
Using the INDEX and COLUMN functions, enter the following formula in cell C2, and then copy it across the next 3 cells in the row:
=INDEX($A$2:$A$5,COLUMN()-COLUMN($C$2)+1)
Alternative solution:
Select cells C2:F2 and enter the TRANSPOSE function as shown in the following Array formula:
{=TRANSPOSE(A2:A5)}
Solution 2: To transpose from a Row into a Column.
To transpose the values in Row 10 (List2) into a Column:
Using the INDEX and ROW functions, enter the following formula in cell H10, and then copy it down to the next 4 cells in the column:
=INDEX($B$10:$F$10,ROW()-ROW($H$10)+1)
Alternative solution:
Select cells H10:H14 and enter the TRANSPOSE function as shown in the following Array formula:
{=TRANSPOSE(B10:F10)}
Thanz
Sukumar