Require macro to extend a table rows based on value input in a cell

Hi

I am currently generating a workbook, which consisits of several tables located on various sheets. I require a macro that allows me to input a value (for number of rows required) in a cell, which will then automatically insert that set number of rows to the last row of the table located on another worksheet. Please note that the new rows will need to copy the formulas located in previous rows.

Currently I have the following macro which is able to locate the last row with data in it, now I need the rest of the macro that copys the formulas from this row and inserts the set number of rows (input in a cell on another worksheet) and copy the formulas across to these new rows.

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = “$C$9” Then

Sub InsertRowsAndFillFormulas()

Worksheets(“Raw_Data”).Activate

Dim FinalRow As Long
FinalRow = Sheets(“Raw_Data”).Range(“B” & Rows.Count).End(xlUp).Row
ActiveSheet.Rows(FinalRow).Select

 

End Sub

Please help as my macro skills are terrible. Thank you in advance.

 

One thought on “Require macro to extend a table rows based on value input in a cell

Leave a Reply

Your email address will not be published. Required fields are marked *