Posted to microsoft.public.excel.misc
|
|
How to move data from rows to columns
I use a very simple sub
For Each c In Worksheets("sheet1").Range("a1:z100")
d = c.Row - 1
e = c.Column - 1
Worksheets("sheet2").Range("a1").Offset(e, d) = c.Value
Next
You can change the ranges to shift the data position.
this places the repositioned data on sheet2 but youu can always delete
sheet1 and rename sheet2
"How to move data from rows to columns" wrote:
My data is sorted as shown, but each employee has between 1-5 rows of data.
"Rick Rothstein" wrote:
Is your data sorted by (assumed) Column A (the employee column) as shown, or
could the employees be scattered all about in that column?
--
Rick (MVP - Excel)
"How to move data from rows to columns" <How to move data from rows to
wrote in message
...
I am trying to move multiple rows of data to columns.
For example, I have multiples rows of different data for employee A and
want
one row for employee A that has the multiple rows of data in columns
instead.
Currently I have:
Employee A, dependent 1, birth date
Employee A, dependent 2, birth date
Employee B, dependent 1, birth date
Employee C, dependent 1, birth date
Employee C, dependent 2, birth date
Employee C, dependent 3, birth date
And I want
Employee A, dependent 1, birth date, dependent 2, birth date
Employee B, dependent 1, birth date
Employee C, dependent 1, birth date, dependent 2, birth date, dependent 3,
birth date
I've tried transpose (but have too many columns) and pivot tables, but
haven't been able to get anything to work. Can you help?
|