Private Sub CommandButton1_Click()
Dim NewRow As Long
Dim m As Variant
Application.DisplayAlerts = False
With wsIngData
NewRow = .Range("A" & .Rows.count).End(xlUp).Row + 1
.Range("B" & NewRow).Value = Me.TextBox1.Text
.Range("I" & NewRow).Value = Me.TextBox2.Text
.Range("C" & NewRow).Value = Me.TextBox3.Text
.Range("D" & NewRow).Value = Me.TextBox4.Text
.Range("E" & NewRow).Value = Me.TextBox5.Text
.Range("F" & NewRow).Value = Me.TextBox6.Text
.Range("H" & NewRow).Value = Me.TextBox7.Text
.Range("A" & NewRow).Value = Me.ComboBox1.Text
.Range("J" & NewRow).Value = IIf(Me.opt_In.Value, "IN", "OUT")
.Range("G" & NewRow).Value = Me.DTPicker1.Value
.Range("K" & NewRow).Value = Now
End With
'update master
With wsIngMaster
m = Application.Match(Val(Me.ComboBox1.Text), .Columns(1), 0)
If Not IsError(m) Then
With .Cells(CLng(m), "D")
If Me.opt_In Then
.Value = .Value + Val(Me.TextBox5.Value)
ElseIf Me.opt_Out Then
.Value = .Value - Val(Me.TextBox5.Value)
End If
End With
End If
End With
opt_In.Value = False
Application.DisplayAlerts = True
Unload Me
End Sub