Macro que inserte filas automáticamente y permita sumar total
A los miembro del Foro, en esta ocasión necesito su ayuda en una macro que tengo la cual me permite inserta filas automáticamente a presionar en el botón INSERTAR FILAS, pero a la vez tengo una la fórmula en el texto donde indica TOTAL GENERAL "=SUMA(L8:L9)" y lo que necesito es que si inserto 5 más 2 que tengo por defecto mi fórmula suma debería incrementar a =SUMA(L8:L14), pero no permite hacer este cambio.
Adjunto Macro
Sub Insertar_filas()
Dim vRows As Integer
Application.ScreenUpdating = False
Cells(Rows.Count, "AQ").End(xlUp).Select
ActiveCell.EntireRow.Select
If Application.WorksheetFunction.CountIf(ActiveCell.EntireRow, "<>") = 0 Then Exit Sub
If vRows <> 1 Then
vRows = Application.InputBox(prompt:= _
"Introduce el nº de filas a insertar", Title:="Insertar Filas", _
Default:="", Type:=1)
If vRows = False Then GoTo Salir
End If
Dim sht As Worksheet, shts() As String, i As Integer
ReDim shts(1 To Worksheets.Application.ActiveWorkbook. _
Windows(1).SelectedSheets.Count)
i = 0
For Each sht In _
Application.ActiveWorkbook.Windows(1).SelectedSheets
Sheets(sht.Name).Select
i = i + 1
shts(i) = sht.Name
Selection.Resize(rowsize:=2).Rows(2).EntireRow. _
Resize(rowsize:=vRows).Insert Shift:=xlDown
Selection.AutoFill Selection.Resize( _
rowsize:=vRows + 1), xlFillDefault
On Error Resume Next
Selection.Offset(1).Resize(vRows).EntireRow. _
SpecialCells(xlConstants).ClearContents
Next sht
Worksheets(shts).Select
Application.ScreenUpdating = True
Salir:
End Sub