Hello,
I have set up the following code in VBA to insert rows into my table.
Here is the code
Dim myLastRow As Long
myLastRow = Worksheets("Before n After Remap Review").Range("A7").End(xlDown).Row
MsgBox prompt:="The last row is Row No. " & myLastRow
Dim x As Integer
x = Application.InputBox("Number of Rows", "Number of Rows", Type:=1)
Range(ActiveCell, ActiveCell.Offset(x - 1, 0)).EntireRow.Insert Shift:=xlDown
Dim strSum As String
Dim LR As Long
strSum = "=SUM($A$8:$A$@LR)"
LR = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(LR, 1).Resize(, 5).Formula = Replace(strSum, "@LR", LR)
I need to adjust this code to be able to add or delete rows without a prompt based on the new data I am inputting. Could anyone please assist.
I have set up the following code in VBA to insert rows into my table.
Here is the code
Dim myLastRow As Long
myLastRow = Worksheets("Before n After Remap Review").Range("A7").End(xlDown).Row
MsgBox prompt:="The last row is Row No. " & myLastRow
Dim x As Integer
x = Application.InputBox("Number of Rows", "Number of Rows", Type:=1)
Range(ActiveCell, ActiveCell.Offset(x - 1, 0)).EntireRow.Insert Shift:=xlDown
Dim strSum As String
Dim LR As Long
strSum = "=SUM($A$8:$A$@LR)"
LR = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(LR, 1).Resize(, 5).Formula = Replace(strSum, "@LR", LR)
I need to adjust this code to be able to add or delete rows without a prompt based on the new data I am inputting. Could anyone please assist.