Copy row and change details
Hello
I have created a macro in Excel (using the Record Macro function) that inserts a copy of row 13 and changes some of the details in the copied row (please see code below). Is it possible to amend the code so that it copies a highlighted row instead of always row 13 and changes the details of the new row?
Kind regards.
Taryn
=================================
Sub BankCharges()
'
' BankCharges Macro
' Inserts Bank Charges Script (JNW1)
'
' Keyboard Shortcut: Ctrl+Shift+B
'
Rows("13:13").Select
Selection.Copy
Selection.Insert Shift:=xlDown
Rows("14:14").Select
Selection.Font.Bold = False
Range("H14").Select
ActiveCell.FormulaR1C1 = "8920"
Range("I14").Select
ActiveCell.FormulaR1C1 = "8920"
Range("K14").Select
ActiveCell.FormulaR1C1 = "NL"
Range("O14").Select
ActiveCell.FormulaR1C1 = "=0-R[-1]C"
Range("O15").Select
End Sub
|