This is what happened when I added the code and tried again, must have put it in the wrong spot
https://www.screencast.com/t/rI5U3AYJp0N
This is all the code I have off that sheet
Private Sub TextBox1_Change()
With Me.Shapes("TextBox1")
.Top = 5
Me.Rows(9).RowHeight = .Height + 10
End With
End Sub
Private Sub cmdAddRow_Click()
ActiveSheet.Unprotect Password:="npssadmin"
Dim ws As Worksheet
Set ws = ActiveSheet
Dim tbl As ListObject
Set tbl = ws.ListObjects("npss_quote")
'add a row at the end of the table
tbl.ListRows.Add
ActiveSheet.Protect Password:="npssadmin"
Application.EnableEvents = True
End Sub
Private Sub cmdDeleteRow_Click()
ActiveSheet.Unprotect Password:="npssadmin"
Dim ans As Long
With ActiveSheet.ListObjects("npss_quote").DataBodyRange
ans = .Rows.Count
If ans > 1 Then .Rows(ans).Delete
If ans = 1 Then .Rows(1).Cells.SpecialCells(xlCellTypeConstants).ClearContents
End With
'Selection.ListObject.ListRows(6).Delete
ActiveSheet.Protect Password:="npssadmin"
Application.EnableEvents = True
End Sub
Private Sub CommandButton2_Click()
'Modified 8/30/2018 9:24:30 PM EDT
'Dim ans As Long
'With ActiveSheet.ListObjects("npss_quote").DataBodyRange
' ans = .Rows.Count
' If ans > 1 Then .Rows(ans).Delete
' If ans = 1 Then .Rows(1).Cells.SpecialCells(xlCellTypeConstants).ClearContents
' End With
End Sub
Private Sub cmdDelRow_Click()
Rows("7:7").Select
Selection.Delete Shift:=xlUp
End Sub
Private Sub cmdDelSelect_Click()
ActiveSheet.Unprotect Password:="npssadmin"
Dim rng As Range
On Error Resume Next
With Selection.Cells(1)
Set rng = Intersect(.EntireRow, ActiveCell.ListObject.DataBodyRange)
On Error GoTo 0
If rng Is Nothing Then
MsgBox "Please select a cell within a row that you want to delete.", vbCritical
Else
rng.Delete xlShiftUp
End If
End With
Application.EnableEvents = True
ActiveSheet.Protect Password:="npssadmin"
End Sub
Private Sub CommandButton1_Click()
Rows("7:7").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A:A")) Is Nothing Then
Application.EnableEvents = False
If Target.Cells.CountLarge > 1 Or IsEmpty(Target) Then Exit Sub
If Target.Value < Date Then
ans = MsgBox("This input is older than today !....Are you sure that is what you want ???", vbYesNo)
If ans = vbNo Then Target.Value = ""
End If
End If
Application.EnableEvents = True
End Sub
Sub Reset_Me()
Application.EnableEvents = True
End Sub