Skip to main content
Support is Offline
Today is our off day. We are taking some rest and will come back stronger tomorrow
Official support hours
Monday To Friday
From 09:00 To 17:30
  Friday, 12 October 2018
  0 Replies
  3.3K Visits
0
Votes
Undo
Hello, I need help, this is how my table looks, for example, when I add 2 row at the end of my 1st table, I want the vba help me to do the same thing for the table below (add 2 rows at the end of the table). So my job will be, only need to add rows at the 1st table, the table bellows all will generate rows automatically based on numbers of row in the 1st table. the are the coding I used now to add row for the 1st table. I hope someone can solve this issue for me, thx.

Sub InsertNumRows()

ActiveCell.EntireRow.Copy

Dim Rng As Long

Application.DisplayAlerts = False
On Error Resume Next
Rng = InputBox("Enter number of rows required.")
On Error GoTo 0
Application.DisplayAlerts = True

If Rng = 0 Then
MsgBox "You didn't specify a range!"
Exit Sub

Else
Range(ActiveCell.Offset(1, 0), ActiveCell.Offset(Rng, 0)).Select
Selection.EntireRow.Insert Shift:=xlDown
End If

End Sub [attachment]Capture 1.PNG[/attachment]
There are no replies made for this post yet.