Sub InsertRows2()
Dim wb As Workbook
Dim ws As Worksheet ': Set ws = ThisWorkbook.ActiveSheet
Dim i As Long, x As Long
Dim tb As ListObject
Dim NewRow As ListRow
Dim C As String
Dim Start_No As String
Dim End_No As String
Dim TotalNewRows As String
Dim Lastrow As Long
Dim lrow As Long
Dim D As Range
Set wb = ThisWorkbook
Set ws = wb.Sheets("Sheet1") 'Added SPS,06/16/22, worksheet the table is on
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Assign a variable to hold our table
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Set tb = ws.ListObjects("Table1")
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Find last row, if table header is in row 1 of worksheet
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
lrow = tb.Range.Rows.Count
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Find last row, if table header is not in row 1 of worksheet LAST ROW (lrow) = 14
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
lrow = tb.Range.Rows(tb.Range.Rows.Count).Row
Start_No = InputBox("Enter Starting PO Number in Block") 'START NUMBER (Start_No) = 60
End_No = InputBox("Enter Ending PO Number in Block") 'END NUMBER (End_No) = 67
TotalNewRows = End_No - Start_No 'TOTAL NUMBER OF NEW ROWS NEEDED FOR NEW BLOCK OF PO NUMBERS (TotalNewRows) = 7
Cells(lrow + 1, 2) = Start_No
C = Cells(lrow + 1, 2)
'i = Application.InputBox("How many rows would you like to add?", "Insert Rows", 1, Type:=1)
i = TotalNewRows
Set tb = ws.ListObjects(1)
For x = 1 To i
Set NewRow = tb.ListRows.Add(AlwaysInsert:=True)
Next x
With tb.Range.Columns(2) 'column_to_check is relative to the tb.Range
Set D = .Find(what:=Start_No, after:=.Cells(1), LookIn:=xlValues, _
searchorder:=xlByRows, searchdirection:=xlPrevious)
If Not D Is Nothing Then
Debug.Print D.Row + 1 'last empty row
D.Select
Selection.AutoFill Destination:=Range(D & Rows.Count).End(xlUp), Type:=xlFillSeries
End If
End With
End Sub