Hi All,
I have attached the following code which allows the user to insert a user-defined number of rows in a sheet, however, I would like to control this insert function to a specified name range. Any idea's how this can be achieved?
Let say the named range is "Labour_Insert_Range" for example.
Thanks in advance,
I have attached the following code which allows the user to insert a user-defined number of rows in a sheet, however, I would like to control this insert function to a specified name range. Any idea's how this can be achieved?
Let say the named range is "Labour_Insert_Range" for example.
Code:
Sub Insert_Rows()
Dim Rng, n As Long, k As Long
Application.ScreenUpdating = False
Rng = InputBox("Enter number of rows required.")
If Rng = "" Then Exit Sub
ActiveSheet.Columns.Hidden = False
Range(ActiveCell, ActiveCell.Offset(Val(Rng) - 1, 0)).EntireRow.Insert
k = ActiveCell.Offset(-1, 0).Row
n = Cells(k, 744).End(xlToLeft).Column
Range(Cells(k, 1), Cells(k + Val(Rng), n)).FillDown
Search_Date_Hide_Columns
End Sub