how to insert rows and copy cells in Excel VBA
Posted on 2011-02-22
Using VBA code, I need to go through a range of cells in column P, and where column P contains data, I need to check the quantity on that row (col H). If the quantity on that row is greater than 1.......
Here's the part I don't know how to do:.....
If the quantity on that row is greater than 1, Insert (quantity minus one) rows BELOW that row, AND copy down the data in cells I & J, AND make those cells in column Q yellow interior.
For example, if the code discovers that cell P20 has data and cell H20 = 4, then insert new rows 21, 22, and 23. Copy I20:J20 down to I23:J23. Make Q20:Q23 yellow interior. Then, the next cell in the range and repeat.