According to the new information.
We start again...
Create your user form with 4 textboxes.
Put the following code in commandbutton1:
VBA Code:
Private Sub CommandButton1_Click()
Dim i As Long, lr
Dim Foundit As Boolean
If TextBox1.Value = "" Then
MsgBox "Enter Product"
TextBox1.SetFocus
Exit Sub
End If
If TextBox2.Value = "" Then
MsgBox "Enter Process"
TextBox2.SetFocus
Exit Sub
End If
If TextBox3.Value = "" Or Not IsNumeric(TextBox3.Value) Then
MsgBox "Enter hours"
TextBox3.SetFocus
Exit Sub
End If
If TextBox4.Value = "" Or Not IsNumeric(TextBox4.Value) Then
MsgBox "Enter qty"
TextBox4.SetFocus
Exit Sub
End If
lr = Range("A" & Rows.Count).End(3).Row
For i = 1 To lr
If Range("A" & i).Value = TextBox1.Value And Range("B" & i).Value = TextBox2.Value Then
Foundit = True
Exit For
End If
Next
If Foundit = False Then
i = lr + 1
Range("A" & i).Value = TextBox1.Value
Range("B" & i).Value = TextBox2.Value
End If
Range("C" & i).Value = Range("C" & i).Value + TextBox3.Value
Range("D" & i).Value = Range("D" & i).Value + TextBox4.Value
TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
TextBox4.Value = ""
End Sub
So you capture the 4 data and press the button.
I attach the file again with the new form and the new code.
drive.google.com
Note: You must download the file to your computer and then you can edit it.
--------------
I hope to hear from you soon.
Respectfully
Dante Amor
--------------
"Si no sabes por dónde empezar, empieza por un café."
"If you don't know where to start, start with a coffee."