Hello,
I need insert row under selected row, copy formulas and conditional and paste to new row.
Can you someone modify this macro what i found. It copy all and works werry good, but insert also text.
Thank you very much
I need insert row under selected row, copy formulas and conditional and paste to new row.
Can you someone modify this macro what i found. It copy all and works werry good, but insert also text.
Code:
Private Sub cmdInsertRow_Click()
Dim lRow As Long
Dim lRsp As Long
On Error Resume Next
lRow = Selection.Row()
lRsp = MsgBox("Insert New row under " & 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
'Paste formulas and conditional formatting in new row created
Rows(lRow).PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone
End Sub
Thank you very much