This should sort the first error.
Private Sub btnAdd_Click()
Dim ws As Worksheet
Dim i As Variant
Dim newRow As Long
Set ws = Worksheets("Overstocks")
newRow = Application.WorksheetFunction.CountA(ws.Range("A:A")) + 1
ws.Cells(newRow, 1).Value = Me.txtBrand.Value
ws.Cells(newRow, 2).Value = Me.cbCategory.Value
ws.Cells(newRow, 3).Value = Me.txtQuantity.Value
ws.Cells(newRow, 4).Value = IIf(opYes.Value, "Yes", "No")
ws.Cells(newRow, 5).Value = Date
Clear_Form
'validate textbox entry
Dim ctrl As Control
For Each ctrl In Me.Controls
If TypeOf ctrl Is MSForms.TextBox Then
If ctrl.Value = vbNullString Then
MsgBox "You must complete all entries"
ctrl.SetFocus
Unload Me
Exit Sub
End If
End If
Next ctrl
End Sub
Not sure where to look for the other code that's causing problems, where is that located?
Bookmarks