I am very close on this. I need the code to prompt user for data that will need to be pasted into the newly inserted rows in columns b and c only. The code I have currently copies a range of rows from one sheet "Copy" and inserts those rows below the selected row in another sheet "WellDetail". I need it to do 2 things.
1 - This one is optional, but would save me time... It would be quicker if I didnt have to select the row which I'd like the "Copy" data inserted beneath. Not positive on how to make that work as the last active row where new rows will be inserted is variable as new rows are inserted into the sheet.
2 - I need data pasted into columns b and c of the newly inserted rows only. The data needing to be pasted into columns b and c are variable and should be based on user input.
1 - This one is optional, but would save me time... It would be quicker if I didnt have to select the row which I'd like the "Copy" data inserted beneath. Not positive on how to make that work as the last active row where new rows will be inserted is variable as new rows are inserted into the sheet.
2 - I need data pasted into columns b and c of the newly inserted rows only. The data needing to be pasted into columns b and c are variable and should be based on user input.
VBA Code:
Public Sub InsertCopiedRows()
On Error GoTo InsertCopiedCells_Error
'IT IS NECESSARY TO CALL THIS MACRO FROM THE SHEET "WellDetail"
'WITH A ROW SELECTED AND IS WHERE BELOW THIS ROW WILL BE
'INSERTED THE ROWS 2 TO 16 COPIED FROM THE SHEET "Copy"
Dim a As Integer
Sheets("Copy").Rows("2:16").Copy
Sheets("WellDetail").Select
ActiveCell.Offset(1, 0).Insert Shift:=xlDown
Application.CutCopyMode = False
On Error GoTo 0
Exit Sub
InsertCopiedCells_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure InsertCopiedCells, line " & Erl & "."
End Sub