Hi,
I have a worksheet which has a button for users to press to add a new line underneath the active cell
It copies the existing row and pastes underneath after asking for permission
I need to clear the contents from column B and C on the new row only
Specific cell references can't be used as they may add multiple new lines, so I'm looking to use active cell, but I don't know how to refer to the row below and only 2 cells of that row
this is my existing code if someone has a suggestion on how to clear what I'm looking to?
I have a worksheet which has a button for users to press to add a new line underneath the active cell
It copies the existing row and pastes underneath after asking for permission
I need to clear the contents from column B and C on the new row only
Specific cell references can't be used as they may add multiple new lines, so I'm looking to use active cell, but I don't know how to refer to the row below and only 2 cells of that row
this is my existing code if someone has a suggestion on how to clear what I'm looking to?
Code:
ThisWorkbook.Worksheets("RequisitionForm").Unprotect ("*")
Dim lRow As Long
Dim lRsp As Long
On Error Resume Next
lRow = Selection.Row()
lRsp = MsgBox("Insert new line below row " & lRow & "?", _
vbQuestion + vbYesNo)
If lRsp <> vbYes Then Exit Sub
Rows(lRow).Select
Selection.Copy
Rows(lRow + 1).Select
Selection.Insert Shift:=xlDown
Application.CutCopyMode = False
Rows(lRow).PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone
Range(ActiveCell, ActiveCell.1(xlDown).1(xlToRight)).Select
ThisWorkbook.Worksheets("RequisitionForm").Protect ("*")
End Sub