PDA

View Full Version : Request: Excel Horizontal to Vertical



edinburgh
2014-02-05, 07:51 AM
Site
AZ1
AZ2
AZ3
Height
Address


Site001
0
120
240
55
Address1


Site002
10
100
250
40
Address2


Site003
12
100
300
45
Address3


Site004
15
140
blank
20
Address4


Site005
18
136
300
35
Address5



The table above is what I have.

The table below is what I would need macro to transpose:



Site
AZ
Height
Address


Site001
0
55
Address1


Site001
120
55
Address1


Site001
240
55
Address1


Site002
10
40
Address2


Site002
100
40
Address2


Site002
250
40
Address2


Site003
12
45
Address3


Site003
100
45
Address3


Site003
300
45
Address3


Site004

15
20
Address4


Site004
140
20
Address4


Site005
18
35
Address5


Site005
136
35
Address5


Site005
300
35
Address5




But here Site 004 has only 2 AZ and it should be copy/make only 2 rows.

Hello Experts, Please kindly help me to get maco for Excel 2007.

Thanks.

BR//
Edin

_ct_
2014-02-06, 06:39 PM
I've made an Excel spreadsheet with a Macro to convert the data. You can download it here: https://dl.dropboxusercontent.com/u/902642/Expand_Data.xlsm

edinburgh
2014-02-07, 01:19 AM
Perfect...Perfect...Perfect....

Download and already tested...working perfect...

Thanks and give reputation....

liukang
2014-02-07, 02:45 AM
Site
AZ1
AZ2
AZ3
Height
Address


Site001
0
120
240
55
Address1


Site002
10
100
250
40
Address2


Site003
12
100
300
45
Address3


Site004
15
140
blank
20
Address4


Site005
18
136
300
35
Address5



The table above is what I have.

The table below is what I would need macro to transpose:



Site
AZ
Height
Address


Site001
0
55
Address1


Site001
120
55
Address1


Site001
240
55
Address1


Site002
10
40
Address2


Site002
100
40
Address2


Site002
250
40
Address2


Site003
12
45
Address3


Site003
100
45
Address3


Site003
300
45
Address3


Site004
15
20
Address4


Site004
140
20
Address4


Site005
18
35
Address5


Site005
136
35
Address5


Site005
300
35
Address5




But here Site 004 has only 2 AZ and it should be copy/make only 2 rows.

Hello Experts, Please kindly help me to get maco for Excel 2007.

Thanks.

BR//
Edin

No need any macro, just copy and paste special -> select transpose

edinburgh
2014-02-08, 01:02 AM
Everyone even idiot knows how to copy and paste...

But Only programmer knows how to write macro for saving time...

_ct_
2014-02-08, 02:57 AM
Hi, I think Transpose only swaps rows and columns - that's not the output format @edinburgh was looking for.