krishna008
New Member
- Joined
- Jan 7, 2010
- Messages
- 12
Hi All,
I have a little bit of VBA knowledge but am struggling with this one.
I have a data extraction from an accounting system. The first half of the data is represented horizontally as expected, but the second half of the data is somehow expressed vertically (a can of worms I don't need to go into right now).
I need a way to transpose this vertical data to the corresponding row, delete the rows no longer required, then continue for the next record and so on. This data will having varying rows so ideally need to make sure it can handle that.
Here is a screenshot of the spreadsheet to show you what I mean but I can attach a truncated copy of the file if needed.
First I need just one version of the data in AB2:AB55 to copies and transposed to AD1 to provide headings.
Then need AC2:AC55 to be transposed to AD2. I then need rows 3:55 to be deleted.
Then need to repeat the same for the next WOnumber (which is in column A) but it will be on the next row down (AC3:56 transposed to AD3, then delete 4:56 to be deleted and so on).
I go the vb macro code from the mr.excel forum, however my sheet has the empty values in the AC column. and also I have the different data types. I want to copy what ever there under AC column and transpose them under AD.
I will be adding some formatting to the code but I can add this myself
Thank you in advance!
Data sheet. unable to post entire sheet due to restriction of 300 cells, but I will have the 100+ WO# and corresponding data in the other cells. Here I gave only one WO# example.
Expected Reusult:
I will delete the original AB:AC columns using the "columns("AB:AC").Delete" option.
This is the code I got it from the Mr.Excel forum, but it does not work if the AC column has many empty values.
I have a little bit of VBA knowledge but am struggling with this one.
I have a data extraction from an accounting system. The first half of the data is represented horizontally as expected, but the second half of the data is somehow expressed vertically (a can of worms I don't need to go into right now).
I need a way to transpose this vertical data to the corresponding row, delete the rows no longer required, then continue for the next record and so on. This data will having varying rows so ideally need to make sure it can handle that.
Here is a screenshot of the spreadsheet to show you what I mean but I can attach a truncated copy of the file if needed.
First I need just one version of the data in AB2:AB55 to copies and transposed to AD1 to provide headings.
Then need AC2:AC55 to be transposed to AD2. I then need rows 3:55 to be deleted.
Then need to repeat the same for the next WOnumber (which is in column A) but it will be on the next row down (AC3:56 transposed to AD3, then delete 4:56 to be deleted and so on).
I go the vb macro code from the mr.excel forum, however my sheet has the empty values in the AC column. and also I have the different data types. I want to copy what ever there under AC column and transpose them under AD.
I will be adding some formatting to the code but I can add this myself
Thank you in advance!
Data sheet. unable to post entire sheet due to restriction of 300 cells, but I will have the 100+ WO# and corresponding data in the other cells. Here I gave only one WO# example.
Input.xlsx | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | AA | AB | AC | |||
1 | WO# | Header1 | Header2 | Header3 | Header4 | Header5 | Header6 | Header7 | Header8 | Header9 | Header10 | Header11 | Header12 | Header13 | Header14 | Header15 | Header16 | Header17 | Header18 | Header19 | Header20 | Header21 | Header22 | Header23 | Header24 | Header25 | Header26 | Question | Answer | ||
2 | 1234 | Row1.01 | Row1.02 | Row1.03 | Row1.04 | Row1.05 | Row1.06 | Row1.07 | Row1.08 | Row1.09 | Row1.10 | Row1.11 | Row1.12 | Row1.13 | Row1.14 | Row1.15 | Row1.16 | Row1.17 | Row1.18 | Row1.19 | Row1.20 | Row1.21 | Row1.22 | Row1.23 | Row1.24 | Row1.25 | Row1.26 | Question1 | Answer1 | ||
3 | Question2 | Answer2 | |||||||||||||||||||||||||||||
4 | Question3 | Answer3 | |||||||||||||||||||||||||||||
5 | Question4 | Answer4 | |||||||||||||||||||||||||||||
6 | Question5 | Answer5 | |||||||||||||||||||||||||||||
7 | Question6 | Answer6 | |||||||||||||||||||||||||||||
8 | Question7 | Answer7 | |||||||||||||||||||||||||||||
9 | Question8 | Answer8 | |||||||||||||||||||||||||||||
10 | Question9 | Answer9 | |||||||||||||||||||||||||||||
11 | Question10 | Answer10 | |||||||||||||||||||||||||||||
12 | Question11 | Answer11 | |||||||||||||||||||||||||||||
13 | Question12 | Answer12 | |||||||||||||||||||||||||||||
14 | Question13 | Answer13 | |||||||||||||||||||||||||||||
15 | Question14 | Answer14 | |||||||||||||||||||||||||||||
16 | Question15 | Answer15 | |||||||||||||||||||||||||||||
17 | Question16 | Answer16 | |||||||||||||||||||||||||||||
18 | Question17 | Answer17 | |||||||||||||||||||||||||||||
19 | Question18 | Answer18 | |||||||||||||||||||||||||||||
20 | Question19 | Answer19 | |||||||||||||||||||||||||||||
21 | Question20 | Answer20 | |||||||||||||||||||||||||||||
22 | Question21 | Answer21 | |||||||||||||||||||||||||||||
23 | Question22 | Answer22 | |||||||||||||||||||||||||||||
24 | Question23 | Answer23 | |||||||||||||||||||||||||||||
25 | Question24 | Answer24 | |||||||||||||||||||||||||||||
26 | Question25 | Answer25 | |||||||||||||||||||||||||||||
27 | Question26 | ||||||||||||||||||||||||||||||
28 | Question27 | Answer27 | |||||||||||||||||||||||||||||
29 | Question28 | Answer28 | |||||||||||||||||||||||||||||
30 | Question29 | Answer29 | |||||||||||||||||||||||||||||
31 | Question30 | Answer30 | |||||||||||||||||||||||||||||
32 | Question31 | Answer31 | |||||||||||||||||||||||||||||
33 | Question32 | Answer32 | |||||||||||||||||||||||||||||
34 | Question33 | Answer33 | |||||||||||||||||||||||||||||
35 | Question34 | Answer34 | |||||||||||||||||||||||||||||
36 | Question35 | Answer35 | |||||||||||||||||||||||||||||
37 | Question36 | Answer36 | |||||||||||||||||||||||||||||
38 | Question37 | Answer37 | |||||||||||||||||||||||||||||
39 | Question38 | Answer38 | |||||||||||||||||||||||||||||
40 | Question39 | Answer39 | |||||||||||||||||||||||||||||
41 | Question40 | Answer40 | |||||||||||||||||||||||||||||
42 | Question41 | ||||||||||||||||||||||||||||||
43 | Question42 | Answer42 | |||||||||||||||||||||||||||||
44 | Question43 | Answer43 | |||||||||||||||||||||||||||||
45 | Question44 | ||||||||||||||||||||||||||||||
46 | Question45 | Answer45 | |||||||||||||||||||||||||||||
47 | Question46 | Answer46 | |||||||||||||||||||||||||||||
48 | Question47 | Answer47 | |||||||||||||||||||||||||||||
49 | Question48 | Answer48 | |||||||||||||||||||||||||||||
50 | Question49 | Answer49 | |||||||||||||||||||||||||||||
51 | Question50 | Answer50 | |||||||||||||||||||||||||||||
52 | Question51 | Answer51 | |||||||||||||||||||||||||||||
53 | Question52 | Answer52 | |||||||||||||||||||||||||||||
54 | Question53 | Answer53 | |||||||||||||||||||||||||||||
55 | Question54 | Answer54 | |||||||||||||||||||||||||||||
Data |
Expected Reusult:
Macro.xlsm | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | AA | AB | AC | AD | AE | AF | AG | AH | AI | AJ | AK | AL | AM | AN | AO | AP | AQ | AR | AS | AT | AU | AV | AW | AX | AY | AZ | BA | BB | BC | BD | BE | BF | BG | BH | BI | BJ | BK | BL | BM | BN | BO | BP | BQ | BR | BS | BT | BU | BV | BW | BX | BY | BZ | CA | CB | CC | CD | CE | |||
1 | WO# | Header1 | Header2 | Header3 | Header4 | Header5 | Header6 | Header7 | Header8 | Header9 | Header10 | Header11 | Header12 | Header13 | Header14 | Header15 | Header16 | Header17 | Header18 | Header19 | Header20 | Header21 | Header22 | Header23 | Header24 | Header25 | Header26 | Question | Answer | Question1 | Question2 | Question3 | Question4 | Question5 | Question6 | Question7 | Question8 | Question9 | Question10 | Question11 | Question12 | Question13 | Question14 | Question15 | Question16 | Question17 | Question18 | Question19 | Question20 | Question21 | Question22 | Question23 | Question24 | Question25 | Question26 | Question27 | Question28 | Question29 | Question30 | Question31 | Question32 | Question33 | Question34 | Question35 | Question36 | Question37 | Question38 | Question39 | Question40 | Question41 | Question42 | Question43 | Question44 | Question45 | Question46 | Question47 | Question48 | Question49 | Question50 | Question51 | Question52 | Question53 | Question54 | ||
2 | 1234 | Row1.01 | Row1.02 | Row1.03 | Row1.04 | Row1.05 | Row1.06 | Row1.07 | Row1.08 | Row1.09 | Row1.10 | Row1.11 | Row1.12 | Row1.13 | Row1.14 | Row1.15 | Row1.16 | Row1.17 | Row1.18 | Row1.19 | Row1.20 | Row1.21 | Row1.22 | Row1.23 | Row1.24 | Row1.25 | Row1.26 | Question1 | Answer1 | Answer1 | Answer2 | Answer3 | Answer4 | Answer5 | Answer6 | Answer7 | Answer8 | Answer9 | Answer10 | Answer11 | Answer12 | Answer13 | Answer14 | Answer15 | Answer16 | Answer17 | Answer18 | Answer19 | Answer20 | Answer21 | Answer22 | Answer23 | Answer24 | Answer25 | Answer27 | Answer28 | Answer29 | Answer30 | Answer31 | Answer32 | Answer33 | Answer34 | Answer35 | Answer36 | Answer37 | Answer38 | Answer39 | Answer40 | Answer42 | Answer43 | Answer45 | Answer46 | Answer47 | Answer48 | Answer49 | Answer50 | Answer51 | Answer52 | Answer53 | Answer54 | |||||
Sheet1 |
I will delete the original AB:AC columns using the "columns("AB:AC").Delete" option.
This is the code I got it from the Mr.Excel forum, but it does not work if the AC column has many empty values.
VBA Macro Transpose/Delete Rows and continue down spreadsheet with differing total number of rows
Hi All, I have a little bit of VBA knowledge but am struggling with this one. I have a data extraction from an accounting system. The first half of the data is represented horizontally as expected, but the second half of the data is somehow expressed vertically (a can of worms I don't need to...
www.mrexcel.com