Insert rows based on value in a certain cell

Microsoft Office excel 2007 home & stude...
November 12, 2010 at 11:31:50
Specs: Windows 7
I hope someone can help me with this problem. I have a price list from my supplier which has the style #, price, and colors a dress comes in. I need to insert a row below each style number for each color. So I was wondering is there an insert row code that could insert rows based on a number I put in the sheet, such as if there were three colors I could create a cell in the row with "3" in it and the macro would use that number to insert the rows and copy the data from above. Also would I have to click on each line and run the macro or could the macro do it to the whole sheet. I.e. separate the "colors available" text into separate cells, perform the counta, use the counta number to insert the row, copy the data from the original row into all the new rows, and transpose the separated colors available text so now each color is on its own separate row, and if possible automatically do that for every row on the sheet. Thanks so much for your help!

See More: Insert rows based on value in a certain cell

November 15, 2010 at 17:55:59
Are you saying that the cell that denotes the "colors available" looks something like this?

Red, Blue, Green

If so, tell us exactly what it looks like and what column it is in.

You said: "I need to insert a row below each style number for each color."

That means that for a style number with 3 colors you would now have 4 rows - the original and 3 new rows below the original one. Is that really what you want or do you just want a single row for each color with the original becoming the row for the first color in the list?

Posting Tip: Before posting Data or VBA Code, read this How-To.

Report •
Related Solutions

Ask Question