imimin
Active Member
- Joined
- May 9, 2006
- Messages
- 404
Hello! Could someone help me with this project?
I need a macro that will 'examine' the contents of column 'C' (see first sample sheet below) and when it finds the text 'ITEM NUMBER' move the selection over 2 columns (column 'E') and examine the contents of that cell. If it finds the number '25', it needs to continue its search in column 'C' where it left off. If it finds a number other than '25' in column 'E' it needs to move the contents of that row and all other rows below it up to the next empty cell to another sheet. A new sheet needs to be created for each different number found. So, if the numbers '5' and '20' are found in the different cells in column 'E', 2 additional sheets need to be created with different groups of 5's and 20's (see sample source and output sheets below).
The bottom line here is that I need a sheet for each grouping of numbers '25' and additional sheet(s) for any additional number(s) that may be found in column 'E'. So, if the numbers 25, 5 and 20 are found in column 'E' adjacent to the text 'ITEM NUMBER' in column 'C', a total of 3 sheets will be created (the one we started with with some rows deleted and 2 additional sheets that are newly created).
Thank you!
Sample source:
Sample output for 20's:
Sample output for 5's:
I need a macro that will 'examine' the contents of column 'C' (see first sample sheet below) and when it finds the text 'ITEM NUMBER' move the selection over 2 columns (column 'E') and examine the contents of that cell. If it finds the number '25', it needs to continue its search in column 'C' where it left off. If it finds a number other than '25' in column 'E' it needs to move the contents of that row and all other rows below it up to the next empty cell to another sheet. A new sheet needs to be created for each different number found. So, if the numbers '5' and '20' are found in the different cells in column 'E', 2 additional sheets need to be created with different groups of 5's and 20's (see sample source and output sheets below).
The bottom line here is that I need a sheet for each grouping of numbers '25' and additional sheet(s) for any additional number(s) that may be found in column 'E'. So, if the numbers 25, 5 and 20 are found in column 'E' adjacent to the text 'ITEM NUMBER' in column 'C', a total of 3 sheets will be created (the one we started with with some rows deleted and 2 additional sheets that are newly created).
Thank you!
Sample source:
outwitDataExport.xls | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | |||
1 | |||||||||||||||||||
2 | ITEM | ITEMNUMBER | 25 | 50 | 75 | 100 | 125 | 150 | Add'l25 | ||||||||||
3 | Invitation | CSN9824C-87 | 294.00 | 316.00 | 338.00 | 360.00 | 430.50 | 501.00 | 70.50 | ||||||||||
4 | OuterEnvelopewithPrintedReturnAddressforInvitation | PRTENV | 37.00 | 39.00 | 41.00 | 43.00 | 51.50 | 60.00 | 8.50 | ||||||||||
5 | LinedInnerEnvelopeforInvitation | LINEDENV | 30.00 | 60.00 | 90.00 | 120.00 | 150.00 | 180.00 | 30.00 | ||||||||||
6 | ReceptionCard | CSR2953C | 139.00 | 146.00 | 153.00 | 160.00 | 183.50 | 207.00 | 23.50 | ||||||||||
7 | RespondCardwithEnvelope | CSE2953C-15 | 174.00 | 186.00 | 198.00 | 210.00 | 245.20 | 280.40 | 35.20 | ||||||||||
8 | InformalNote | CSI2284C-15 | 144.00 | 151.00 | 158.00 | 165.00 | 189.60 | 214.20 | 24.60 | ||||||||||
9 | EnvelopewithPrintedReturnAddressforThankYouorInformalNote | PRTENV | 37.00 | 39.00 | 41.00 | 43.00 | 51.50 | 60.00 | 8.50 | ||||||||||
10 | SavetheDate | CS8774C-91 | 184.00 | 191.00 | 198.00 | 205.00 | 239.00 | 273.00 | 34.00 | ||||||||||
11 | |||||||||||||||||||
12 | |||||||||||||||||||
13 | |||||||||||||||||||
14 | ITEM | ITEMNUMBER | 5 | 15 | 25 | 35 | 45 | 55 | 65 | ||||||||||
15 | Announcement | ERP65SY-227 | 27.00 | 38.00 | 49.00 | 60.00 | 71.00 | 79.00 | 84.00 | ||||||||||
16 | OuterEnvelopewithPrintedReturnAddress | PRTENV | 23.90 | 24.90 | 25.90 | 26.90 | 27.90 | 28.90 | 29.90 | ||||||||||
17 | |||||||||||||||||||
18 | |||||||||||||||||||
19 | ITEM | ITEMNUMBER | 20 | 30 | 40 | 50 | 60 | 70 | Add'l10 | ||||||||||
20 | Invitation | MAN4782-227 | 110.40 | 112.90 | 115.40 | 117.90 | 120.40 | 122.90 | 10.50 | ||||||||||
21 | OuterEnvelopewithPrintedReturnAddress | PRTENV | 22.00 | 23.00 | 24.00 | 25.00 | 26.00 | 27.00 | 2.00 | ||||||||||
22 | ColoredOuterEnvelopewithPrintedReturnAddress | PRTCOLOR | 26.00 | 29.00 | 32.00 | 35.00 | 38.00 | 41.00 | 4.00 | ||||||||||
23 | |||||||||||||||||||
24 | ITEM | ITEMNUMBER | 25 | 50 | 75 | 100 | 125 | 150 | Add'l25 | ||||||||||
25 | Invitation | VA6960-68 | 132.60 | 149.70 | 166.80 | 183.90 | 225.30 | 266.70 | 41.40 | ||||||||||
26 | OuterEnvelopewithPrintedReturnAddress | PRTENV | 23.60 | 24.60 | 29.00 | 33.40 | 37.80 | 42.20 | 4.40 | ||||||||||
27 | InformalNote | VAI6160-15 | 57.00 | 63.30 | 69.60 | 75.90 | 93.00 | 110.10 | 17.10 | ||||||||||
28 | LinedEnvelopes | LINEDENV | 5.40 | 10.80 | 16.20 | 21.60 | 27.00 | 32.40 | 5.40 | ||||||||||
29 | EnvelopewithPrintedReturnAddressforThankYouorInformalNote | PRTENV | 23.60 | 24.60 | 29.00 | 33.40 | 37.80 | 42.20 | 4.40 | ||||||||||
30 | |||||||||||||||||||
Collection1 |
Sample output for 20's:
sample_output_20s.xls | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | |||
1 | ITEM | ITEMNUMBER | 20 | 30 | 40 | 50 | 60 | 70 | 80 | ||||||||||
2 | Announcement | EA8993-227 | 70.00 | 77.00 | 86.00 | 93.00 | 99.00 | 104.00 | 108.00 | ||||||||||
3 | OuterEnvelopewithPrintedReturnAddress | PRTENV | 25.40 | 26.40 | 27.40 | 28.40 | 29.40 | 30.40 | 31.40 | ||||||||||
4 | InformalNote | EAI8956-204 | 43.00 | 44.00 | 45.00 | 46.00 | 47.00 | 48.00 | 49.00 | ||||||||||
5 | EnvelopewithPrintedReturnAddressforThankYouorInformalNote | PRTENV | 25.40 | 26.40 | 27.40 | 28.40 | 29.40 | 30.40 | 31.40 | ||||||||||
6 | |||||||||||||||||||
7 | ITEM | ITEMNUMBER | 20 | 30 | 40 | 50 | 60 | 70 | 80 | ||||||||||
8 | Announcement | EA8932-227 | 59.00 | 67.00 | 75.00 | 82.00 | 86.00 | 92.00 | 97.00 | ||||||||||
9 | OuterEnvelopewithPrintedReturnAddress | PRTENV | 25.40 | 26.40 | 27.40 | 28.40 | 29.40 | 30.40 | 31.40 | ||||||||||
10 | ColoredOuterEnvelopewithPrintedReturnAddress | PRTCOLOR | 29.40 | 32.40 | 35.40 | 38.40 | 41.40 | 44.40 | 47.40 | ||||||||||
11 | |||||||||||||||||||
12 | ITEM | ITEMNUMBER | 20 | 30 | 40 | 50 | 60 | 70 | 80 | ||||||||||
13 | Announcement | EA8974-227 | 70.00 | 77.00 | 86.00 | 93.00 | 99.00 | 104.00 | 108.00 | ||||||||||
14 | OuterEnvelopewithPrintedReturnAddress | PRTENV | 25.40 | 26.40 | 27.40 | 28.40 | 29.40 | 30.40 | 31.40 | ||||||||||
15 | |||||||||||||||||||
16 | ITEM | ITEMNUMBER | 20 | 30 | 40 | 50 | 60 | 70 | Add'l10 | ||||||||||
17 | Invitation | MA4450-227 | 81.40 | 83.90 | 86.40 | 88.90 | 91.40 | 93.90 | 7.90 | ||||||||||
18 | OuterEnvelopewithPrintedReturnAddress | PRTENV | 22.00 | 23.00 | 24.00 | 25.00 | 26.00 | 27.00 | 2.00 | ||||||||||
19 | ColoredOuterEnvelopewithPrintedReturnAddress | PRTCOLOR | 26.00 | 29.00 | 32.00 | 35.00 | 38.00 | 41.00 | 4.00 | ||||||||||
20 | |||||||||||||||||||
Collection1 |
Sample output for 5's:
sample_output_20s.xls | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | |||
1 | ITEM | ITEMNUMBER | 5 | 15 | 25 | 35 | 45 | 55 | 65 | ||||||||||
2 | Announcement | ERP65SY-227 | 27.00 | 38.00 | 49.00 | 60.00 | 71.00 | 79.00 | 84.00 | ||||||||||
3 | OuterEnvelopewithPrintedReturnAddress | PRTENV | 23.90 | 24.90 | 25.90 | 26.90 | 27.90 | 28.90 | 29.90 | ||||||||||
4 | |||||||||||||||||||
5 | ITEM | ITEMNUMBER | 5 | 15 | 25 | 35 | 45 | 55 | 65 | ||||||||||
6 | Announcement | ERP65VP-227 | 27.00 | 38.00 | 49.00 | 60.00 | 71.00 | 79.00 | 84.00 | ||||||||||
7 | OuterEnvelopewithPrintedReturnAddress | PRTENV | 23.90 | 24.90 | 25.90 | 26.90 | 27.90 | 28.90 | 29.90 | ||||||||||
8 | |||||||||||||||||||
9 | ITEM | ITEMNUMBER | 5 | 15 | 25 | 35 | 45 | 55 | 65 | ||||||||||
10 | Announcement | ERP65XP-227 | 27.00 | 38.00 | 49.00 | 60.00 | 71.00 | 79.00 | 84.00 | ||||||||||
11 | OuterEnvelopewithBlankReturnAddress | PRTENV | 23.90 | 24.90 | 25.90 | 26.90 | 27.90 | 28.90 | 29.90 | ||||||||||
12 | |||||||||||||||||||
Collection1 |
Last edited: