Hello, I have an excel Table that I've made a command button to insert row below the row containing the active cell.
It works fine if you are in rows within the table - my problem is if you are in the last row of the table, want to insert a row below that, it doesn't carry forward the formulas, nor the formatting of the table itself. I am not sure how to incorporate that into the vba. In case a range would need to be specified, the table starts on A2 and goes through row W. Thank you for your assistance.
It works fine if you are in rows within the table - my problem is if you are in the last row of the table, want to insert a row below that, it doesn't carry forward the formulas, nor the formatting of the table itself. I am not sure how to incorporate that into the vba. In case a range would need to be specified, the table starts on A2 and goes through row W. Thank you for your assistance.
Code:
Private Sub CommandButton2_Click()
Sheets("Main Table").Select
'Insert row below active cell
ActiveCell.Offset(1).EntireRow.Insert
End Sub