Ok, the following is a macro I'm using to insert and expand two separate sections of my worksheet. The problem is that both of these two spots that I'm expanding reference one another so when I expand if cell E9 is greater than 1 my cell referencing gets screwed up. Is there a way to tell it to expand one row at a time in each spot? So starting in row 10 it would insert and expand one row, then it would insert and expand at row 17, then it would jump back to now row 11 insert and expand, then jump to row 18 insert and expand.... etc. I would need this repeated the number of times represented in cell E9. Any help is extremely appreciated.
Code:
Sub InsertRowsAndFill()
Cells(11, "A").Resize(Range("E9").Value - 1).EntireRow.Insert
Cells(10, "A").EntireRow.Copy Cells(11, "A").Resize(Range("E9").Value - 1)
Cells((18 + Range("E9")), "A").Resize(Range("E9").Value - 1).EntireRow.Insert
Cells((17 + Range("E9")), "A").EntireRow.Copy Cells((18 + Range("E9")), "A").Resize(Range("E9").Value - 1)
End Sub