the script below is for inserting a certain number of blank rows above or below base on the value in a certain cell. For example if the value in cell G3 is 3 then it would insert 3 rows. Tee problem I am running into is that only want to add blank rows to a selected column, in this case column E:G, because the data to he left of the worksheet in column "A:C" can't be shift down. is there anyway to update this?
Sub Insert_Rows()
Column_Number = Int(InputBox("Number of the Column on Which the Cell Values Depend: "))
Above_or_Below = Int(InputBox("Enter 0 to Insert Rows Above Each Row." + vbNewLine + "OR" + vbNewLine + "Enter 1 to Insert Rows Below Each Row."))
Dim Count As Integer
Count = 0
For i = 1 To Selection.Rows.Count
For j = 1 To Int(Selection.Cells(i + Count, Column_Number))
Selection.Cells(i + Above_or_Below + Count, Column_Number).EntireRow.Insert
Count = Count + 1
Next j
Next i
End Sub
This is the result when I use this code:
This is what I want it to do :
Thank you in advance!