ExcelNooberino
New Member
- Joined
- Jan 2, 2019
- Messages
- 43
- Office Version
- 2016
- Platform
- Windows
Hello to you all! So, I'm working on this new UserForm to add some new entrys of info I need to keep track of the data. Basically it has some textboxes and a couple of comboboxes and I'm struggling to change the cell color of the last field (combobox) in the database. It only has two variables, "Inbound" and "Outbound" and I just want to do the typical color assignment with the green color for Inbound and red for Outbound. So far I have this:
Private Sub submitBtn_Click()
erow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Cells(erow, 1) = DTPicker.Value
Cells(erow, 2) = comboRef.Value
Cells(erow, 4) = textQuantity.Text & " KG"
Cells(erow, 5) = textValue.Text
Cells(erow, 6) = textCarrier.Text
Cells(erow, 7) = textCost.Text
Cells(erow, 8) = textLTPR.Text
Cells(erow, 9) = comboBound.Value
If Cells(erow, 2) = "MR0006AAAA0" Then
Cells(erow, 3) = "PURGAS PP"
End If
If Cells(erow, 2) = "MR0007AAAA0" Then
Cells(erow, 3) = "SCRAP PP"
End If
If Cells(erow, 2) = "MR5015AAAA0" Then
Cells(erow, 3) = "HXCA PP MOIDO/JITOS"
End If
If Cells(erow, 2) = "MR5002AAAA0" Then
Cells(erow, 3) = "RECICLADO TICONA"
End If
MsgBox "New entry added successfully!", vbInformation, "New entry added"
myForm.Hide
End Sub