Re: Copy InputBox
Thank you for your help.
This is what I am trying to make the coe do.
I want to insert a blank row and I will put the curser at Column A an the Row above where I want the line inserted (just like the normal built in Excel insert).
But I want to insert the line from Column A to Column Q only and I want to be able to tell it how many lines I want inserted.
The code below works now but I have another problem.
If I open the Inputbox and decide I don't want to do it and
If I click on the cancel button of the InputBox it will error out.
I want it to just stop if I don't enter a number.
Thank you for your help.
Code
Sub InsertRowA601TA()
Application.ScreenUpdating = False
Dim Rg As Range
Dim SRg As String
Dim LRg As String
Dim Rng
Dim i As Long, RowIns As Long
RowIns = InputBox("Enter number of rows required")
If RowIns = "" Then
[C3].Select
Exit Sub
End If
For i = 1 To RowIns
Cells(ActiveCell.Row + 1, 1).Resize(1, 17).Insert _
Shift:=xlDown
Cells(ActiveCell.Row, 1).Resize(1, 2).Copy Destination:=Cells(ActiveCell.Row + 1, 1).Resize(RowIns, 1)
Next i
Cells(ActiveCell.Row + 1, 1).Select
Set Rg = Nothing
ActiveCell.Offset(0, 2).Select
End Sub
Display More