$$Excel-Macros$$ Re: Need Help with Macro, Insert Rows based on another cell's value

2009-04-21 Thread Dustin
Dave, Thank you for responding and for your code! I incorporated your ideas along with Habeeb's (above) and my own ideas and came up with the code below. If you see any room for improvement, please let me know, as I am still very new to this coding. Sub fillInTheRows() Sheets("Raw").Select Ran

$$Excel-Macros$$ Re: Need Help with Macro, Insert Rows based on another cell's value

2009-04-21 Thread Dustin
Habeeb, Thank you for your response! I have taken the concepts in your code and the code in Dave's post below and I have come up with the following. If you have any suggestions or see things that I could do better in it, please let me know as I am still getting the hang of this coding =) Thanks!

$$Excel-Macros$$ Re: Need Help with Macro, Insert Rows based on another cell's value

2009-04-21 Thread Dave Bonallack
Hi Dustin, Paste the following code into a module. Sub InsertMissing() Do Until ActiveCell.Value = "" A = ActiveCell.Value B = ActiveCell.Offset(1, 0).Value If B - A > 1 Then ActiveCell.Offset(1, 0).EntireRow.Select Selection.Insert Shift:=xlDo

$$Excel-Macros$$ Re: Need Help with Macro, Insert Rows based on another cell's value

2009-04-20 Thread Habeeb Mohammed
This could should work Sub insert() i = 1 Do If Range("A" & i).Value = "" Then Exit Do If Range("A" & i + 1).Value - Range("A" & i).Value > 1 Then m = Range("A" & i + 1).Value - Range("A" & i).Value Range("A" & i + 1).Select l = i + 1 For k = 1 To m - 1 Range("A" & l).Select