ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Transpose variable columns of data into addtional rows (https://www.excelbanter.com/excel-programming/323550-transpose-variable-columns-data-into-addtional-rows.html)

Cynthia Gregory

Transpose variable columns of data into addtional rows
 
I have a spreadsheet with column A that has one number that is associated
with every item on that row for a variable amount of columns. I want to
take the items starting in column b Range(Selection,
Selection.End(xlToRight)).Select and then take that data, copy it, transpose
it into row format beginning in column B and going down. The I need to copy
the number that is in Column A that is associated with every item that I
just copied and pasted into rows and copy it down.

One of my dilemmas is that my spreadsheet will contain a variable amount of
rows of data as well. And when I try to copy and transpose the data, I need
to insert the rows for the data to go without overwriting my next row that I
need to do the same with.

Example:
A B C D E
123 Brown Black Red Purple
456 Orange White Yellow

I need it to look like this
A B C D E
123 Brown
123 Black
123 Red
123 Purple
456 Orange
456 White
456 Yellow

I hope you can get the jest of what I need and any and all help is greatly
appreciated.

--
Thanks,
Cynthia G.

"Information is just signs and numbers, while knowledge
involves their meaning. What we want is knowledge, but what
we get is information."
--Heinz R. Pagels



galimi[_2_]

Transpose variable columns of data into addtional rows
 
Cynthia,

I have posted an example file with code to

http://Galimi.com/Examples/Fedex.xls

http://HelpExcel.com

"Cynthia Gregory" wrote:

I have a spreadsheet with column A that has one number that is associated
with every item on that row for a variable amount of columns. I want to
take the items starting in column b Range(Selection,
Selection.End(xlToRight)).Select and then take that data, copy it, transpose
it into row format beginning in column B and going down. The I need to copy
the number that is in Column A that is associated with every item that I
just copied and pasted into rows and copy it down.

One of my dilemmas is that my spreadsheet will contain a variable amount of
rows of data as well. And when I try to copy and transpose the data, I need
to insert the rows for the data to go without overwriting my next row that I
need to do the same with.

Example:
A B C D E
123 Brown Black Red Purple
456 Orange White Yellow

I need it to look like this
A B C D E
123 Brown
123 Black
123 Red
123 Purple
456 Orange
456 White
456 Yellow

I hope you can get the jest of what I need and any and all help is greatly
appreciated.

--
Thanks,
Cynthia G.

"Information is just signs and numbers, while knowledge
involves their meaning. What we want is knowledge, but what
we get is information."
--Heinz R. Pagels





All times are GMT +1. The time now is 12:13 PM.

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