I am using two userforms. One to input the purchase order (by item number). The other userform is to receive the order (by item number). In the receive userform, I created a combobox with a master list of item numbers as options. I would like to use an if then statement so that if the combobox value entered in the receive userform is equal to the item number on the order form from the order userform, that item will be marked as "COMPLETE".
I have tried redefining the combobox value as a variable and nothing happens.
I have also tried pasting the combobox value into a random cell and then checking that cell value against the order list. After it is marked complete, then I delete the pasted combobox value in the random cell. This DOES work. I would like to avoid this extra step if possible though.
Below is my code:
Private Sub cmdAdd_Click()
Dim ItemNoX As Integer
LastItemNo = Cells(Rows.Count, 4).End(xlUp).Row
For ItemNoX = 7 To LastItemNo
If frmReceive.cboItem.Value = Worksheets("Purchase Order").Cells(ItemNoX, 4).Value Then
Worksheets("Purchase Order").Cells(ItemNoX, 10).Value = "COMPLETE"
End If
Next ItemNoX
End Sub