I have a spreadsheet that adds additional rows to a named range. That part works like a charm. I need help with a macro to reset that named range to 10 rows; i.e. delete all but the first 10 rows. It would also be needed to limit the number of rows in the range not to be less than 10 by including an error message that informs the user that the table can not be less than 10 rows.
Below is the code that I have so far. The Rest_Bid_Table sub is where I need the help.
Below is the code that I have so far. The Rest_Bid_Table sub is where I need the help.
Code:
[FONT=Verdana]Sub Add_New_Bid_Item()
Dim j As Variant
' Insert new rows to bid schedule table
' Copy formula from cell above and insert user defined number of rows
Application.CutCopyMode = False
j = InputBox("Number of Bid Items to Add:")
Rows(Range("Bid_Schd").Rows.Count + Range("Bid_Schd").Cells(1, 1).Row - 1).EntireRow.Select
Rows(Selection.Row).Copy
Rows(Selection.Row).Resize(j).EntireRow.Insert Shift:=xlDown
Application.CutCopyMode = True
Range("A1").Select
End Sub[/FONT]
[FONT=Verdana]
Sub Reset_Bid_Schedule()
'Reset and limit bid schedule to a minimum of 10 rows
Range("Bid_Schd").EntireRow.Select 'Need help in selecting all but the first 10 rows
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
End Sub[/FONT]