I have to take take a hyphenated number range in a cell and split it into smaller ranges. The macro would examine the range and if it is greater than 2000 create new rows below and fill it with smaller ranges. Other cells will copy over. I have a large number of records to handle so would appreciate any help.
Here is an example of the original file.
Excel 2007
<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]34814[/TD]
[TD="align: right"]69799[/TD]
[TD="align: right"]139598[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]3[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]154730[/TD]
[TD="align: right"][/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
</tbody>
It would like it to look like this.
Excel 2007
<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1000001[/TD]
[TD="align: right"]1002000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]3[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1002001[/TD]
[TD="align: right"]1004000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]4[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1004001[/TD]
[TD="align: right"]1006000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1006001[/TD]
[TD="align: right"]1008000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]6[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1008001[/TD]
[TD="align: right"]1010000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]7[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1010001[/TD]
[TD="align: right"]1012000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]8[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1012001[/TD]
[TD="align: right"]1014000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]9[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1014001[/TD]
[TD="align: right"]1016000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]10[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1016001[/TD]
[TD="align: right"]1018000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]11[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1018001[/TD]
[TD="align: right"]1020000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]12[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1020001[/TD]
[TD="align: right"]1022000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]13[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1022001[/TD]
[TD="align: right"]1024000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]14[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1024001[/TD]
[TD="align: right"]1026000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]15[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1026001[/TD]
[TD="align: right"]1028000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]16[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1028001[/TD]
[TD="align: right"]1030000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]17[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1030001[/TD]
[TD="align: right"]1032000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]18[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1032001[/TD]
[TD="align: right"]1034000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]19[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]814[/TD]
[TD="align: right"]1799[/TD]
[TD="align: right"]3598[/TD]
[TD="align: right"]1034001[/TD]
[TD="align: right"]1034814[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]20[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]154730[/TD]
[TD="align: right"][/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]1034815[/TD]
[TD="align: right"]1034816[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
</tbody>
Thank you,
Bob
Here is an example of the original file.
Excel 2007
A | B | C | D | E | F | G | H | I | J | K | L | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
order number | Copy number | Plan Number | Plan Name | Total Packages | Total Sheets | Total Images | Control Number Range | Stock Code 1 | Stock Code 2 | Stock Code 3 | Stock Code 4 | |
O'TOOLS AUTO, INC. | 1000001-1034814 | UPDATE Z | ||||||||||
1034815-1034816 |
<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]34814[/TD]
[TD="align: right"]69799[/TD]
[TD="align: right"]139598[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]3[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]154730[/TD]
[TD="align: right"][/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
</tbody>
Sheet1
It would like it to look like this.
Excel 2007
A | B | C | D | E | F | G | H | I | J | K | L | M | N | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Order number | Copy number | Batch Number | Plan Number | Plan Name | Total Packages | Total Sheets | Total Images | Control NumberStart | Control NumberEnd | Stock Code 1 | Stock Code 2 | Stock Code 3 | Stock Code 4 | |
1-01 | O'TOOLS AUTO, INC. | UPDATE Z | ||||||||||||
1-02 | O'TOOLS AUTO, INC. | UPDATE Z | ||||||||||||
1-03 | O'TOOLS AUTO, INC. | UPDATE Z | ||||||||||||
1-04 | O'TOOLS AUTO, INC. | UPDATE Z | ||||||||||||
1-05 | O'TOOLS AUTO, INC. | UPDATE Z | ||||||||||||
1-06 | O'TOOLS AUTO, INC. | UPDATE Z | ||||||||||||
1-07 | O'TOOLS AUTO, INC. | UPDATE Z | ||||||||||||
1-08 | O'TOOLS AUTO, INC. | UPDATE Z | ||||||||||||
1-09 | O'TOOLS AUTO, INC. | UPDATE Z | ||||||||||||
1-10 | O'TOOLS AUTO, INC. | UPDATE Z | ||||||||||||
1-11 | O'TOOLS AUTO, INC. | UPDATE Z | ||||||||||||
1-12 | O'TOOLS AUTO, INC. | UPDATE Z | ||||||||||||
1-13 | O'TOOLS AUTO, INC. | UPDATE Z | ||||||||||||
1-14 | O'TOOLS AUTO, INC. | UPDATE Z | ||||||||||||
1-15 | O'TOOLS AUTO, INC. | UPDATE Z | ||||||||||||
1-16 | O'TOOLS AUTO, INC. | UPDATE Z | ||||||||||||
1-17 | O'TOOLS AUTO, INC. | UPDATE Z | ||||||||||||
1-18 | O'TOOLS AUTO, INC. | UPDATE Z | ||||||||||||
1-19 |
<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1000001[/TD]
[TD="align: right"]1002000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]3[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1002001[/TD]
[TD="align: right"]1004000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]4[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1004001[/TD]
[TD="align: right"]1006000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1006001[/TD]
[TD="align: right"]1008000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]6[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1008001[/TD]
[TD="align: right"]1010000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]7[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1010001[/TD]
[TD="align: right"]1012000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]8[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1012001[/TD]
[TD="align: right"]1014000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]9[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1014001[/TD]
[TD="align: right"]1016000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]10[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1016001[/TD]
[TD="align: right"]1018000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]11[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1018001[/TD]
[TD="align: right"]1020000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]12[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1020001[/TD]
[TD="align: right"]1022000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]13[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1022001[/TD]
[TD="align: right"]1024000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]14[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1024001[/TD]
[TD="align: right"]1026000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]15[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1026001[/TD]
[TD="align: right"]1028000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]16[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1028001[/TD]
[TD="align: right"]1030000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]17[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1030001[/TD]
[TD="align: right"]1032000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]18[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]4000[/TD]
[TD="align: right"]8000[/TD]
[TD="align: right"]1032001[/TD]
[TD="align: right"]1034000[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]19[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]105883[/TD]
[TD="align: right"]814[/TD]
[TD="align: right"]1799[/TD]
[TD="align: right"]3598[/TD]
[TD="align: right"]1034001[/TD]
[TD="align: right"]1034814[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]20[/TD]
[TD="align: right"]6058[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]154730[/TD]
[TD="align: right"][/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]1034815[/TD]
[TD="align: right"]1034816[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
</tbody>
Sheet2
Thank you,
Bob