imimin
Active Member
- Joined
- May 9, 2006
- Messages
- 404
Hello!
I need help with creating a new macro. I think this might be a challenging macro to write (or should I say easy for some of you pros out there if you are up to the challenge)! Any help on this will be GREATLY APPRECIATED and I will owe you!!!
I have a LARGE list of items that each have an “item Number” (column A), “Description”(column B) and a “size/price” field (column C). Most of the items have a single price. However, about 2,000+/- of the items have 2 or more sizes/prices. See table below:
What I need to do is have a macro that will ‘examine’ column C (Size/Price) and do the following:
1) If there is only one price (such as ‘5.00;’ – notice the semicolon after the price and also notice that a size is not associated with the price if there is only one price), then do nothing and move on to the next line.
2) If the column C has more than 1 size/price (such as ‘size:SW - $1,402.73;size:W - $532.29;’) then it needs to add new rows under that row equivalent in number to the number of size/price combos. The item number for the new row(s) will be the same as the one above it followed by a hyphen and the numeric portion of the size (such as 123456-5.5). The ‘Description’ will be copied exactly as the line above it. The size/price (column C) will reflect the size/price for each new item number (such as ‘size:SW - $1,402.73;’ for the first new item number/row and ‘size:W - $532.29;’ for the next new item number/row).
3) This process continues until the end of the data (until the last row in column A (or B or C or whatever) that contains data)
Please see an example of what I am after for an output below:
Thank you VERY MUCH and have a GREAT day!
I need help with creating a new macro. I think this might be a challenging macro to write (or should I say easy for some of you pros out there if you are up to the challenge)! Any help on this will be GREATLY APPRECIATED and I will owe you!!!
I have a LARGE list of items that each have an “item Number” (column A), “Description”(column B) and a “size/price” field (column C). Most of the items have a single price. However, about 2,000+/- of the items have 2 or more sizes/prices. See table below:
Excel Workbook | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | 112143 | 14KY PRIN DIA CHANN BRIDAL SET D.75TW | $887.24; | ||
2 | 112147 | 14KW MATCHING BAND TO 112147 D.37CTW | size:SW - $1,402.73;size:W - $532.29; | ||
3 | 111869 | 14KW MACHINE SET RBC ETER.BAND D.50TW SIZE 7 | size:6 - $424.44;size:6.5 - $424.44;size:7 - $424.44; | ||
Sheet1 |
What I need to do is have a macro that will ‘examine’ column C (Size/Price) and do the following:
1) If there is only one price (such as ‘5.00;’ – notice the semicolon after the price and also notice that a size is not associated with the price if there is only one price), then do nothing and move on to the next line.
2) If the column C has more than 1 size/price (such as ‘size:SW - $1,402.73;size:W - $532.29;’) then it needs to add new rows under that row equivalent in number to the number of size/price combos. The item number for the new row(s) will be the same as the one above it followed by a hyphen and the numeric portion of the size (such as 123456-5.5). The ‘Description’ will be copied exactly as the line above it. The size/price (column C) will reflect the size/price for each new item number (such as ‘size:SW - $1,402.73;’ for the first new item number/row and ‘size:W - $532.29;’ for the next new item number/row).
3) This process continues until the end of the data (until the last row in column A (or B or C or whatever) that contains data)
Please see an example of what I am after for an output below:
Excel Workbook | |||||
---|---|---|---|---|---|
A | B | C | |||
8 | 112143 | 14KY PRIN DIA CHANN BRIDAL SET D.75TW | $887.24; | ||
9 | 112147 | 14KW MATCHING BAND TO 112147 D.37CTW | size:SW - $1,402.73;size:W - $532.29; | ||
10 | 112147-SW | 14KW MATCHING BAND TO 112147 D.37CTW | size:SW - $1,402.73; | ||
11 | 112147-W | 14KW MATCHING BAND TO 112147 D.37CTW | size:W - $532.29; | ||
12 | 111869 | 14KW MACHINE SET RBC ETER.BAND D.50TW | size:6 - $424.44;size:6.5 - $424.44;size:7 - $424.44; | ||
13 | 111869-6 | 14KW MACHINE SET RBC ETER.BAND D.50TW | size:6 - $424.44; | ||
14 | 111869-6.5 | 14KW MACHINE SET RBC ETER.BAND D.50TW | 6.5 - $424.44; | ||
15 | 111869-7 | 14KW MACHINE SET RBC ETER.BAND D.50TW | size:7 - $424.44; | ||
Sheet1 |
Thank you VERY MUCH and have a GREAT day!