Can any one tell me what is wrong with this code please?

I am trying to insert rows from an InputBox in several sections of a sheet then copy the formulas down into the inserted cells in each section.

each row in each section = section one rows

I am trying to insert rows from an InputBox in several sections of a sheet then copy the formulas down into the inserted cells in each section.

each row in each section = section one rows

Code:

Public rng As Long Sub changesheetsize() Dim AC_7 As Range Dim AC_6 As Range Dim AC_5 As Range Dim AC_4 As Range Dim AC_3 As Range Dim AC_2 As Range Dim AC_1 As Range Set AC_7 = Range("A65536").End(xlUp) Set AC_6 = AC_7.End(xlUp) Set AC_5 = AC_6.End(xlUp) Set AC_4 = AC_5.End(xlUp) Set AC_3 = AC_4.End(xlUp) Set AC_2 = AC_3.End(xlUp) Set AC_1 = AC_2.End(xlUp) Application.ScreenUpdating = False rng = InputBox("Enter number of rows required.") AC_1.Select Set AC_1 = AC_1.Offset(-rng, 0) Call InsertRow AC_2.Select Set AC_2 = AC_2.Offset(-rng, 0) Call InsertRow AC_3.Select Set AC_3 = AC_3.Offset(-rng, 0) Call InsertRow AC_4.Select Set AC_4 = AC_4.Offset(-rng, 0) Call InsertRow AC_5.Select Set AC_5 = AC_5.Offset(-rng, 0) Call InsertRow AC_6.Select Set AC_6 = AC_6.Offset(-rng, 0) Call InsertRow AC_7.Select Set AC_7 = AC_7.Offset(-rng, 0) Call InsertRow AC_7.Select Call fdownformula AC_6.Select Call fdownformula AC_5.Select Call fdownformula AC_4.Select Call fdownformula AC_3.Select Call fdownformula AC_2.Select Call fdownformula AC_1.Select Call fdownformula Application.ScreenUpdating = True End Sub Sub InsertRow() If rng = 0 Then Exit Sub Range(ActiveCell, ActiveCell.Offset(Val(rng) - 1, 0)).EntireRow.Insert End Sub Sub fdownformula() Dim n As Long, k As Long 'need To know how many formulas To copy down. 'Assumes from A over To last entry In row. k = ActiveCell.Offset(-1, 0).Row n = Cells(k, 256).End(xlToLeft).Column Range(Cells(k, 1), Cells(k + Val(rng), n)).FillDown End Sub

## Comment