Good afternoon,
Im sure this is staring me in the face, I have the following simple piece of code that if the stock location of the item matches it colours the textbox red.
The item number is pulled from a combobox and it populates all the information but I have a map of the stock locations on a userform made up of textboxes with names that match the stock location.
If they get a match the box colours red.
Im getting type mismatch at the lngRed line? I have used this before? Cant work it out.
Any pointer would be happily accepted.
P
Im sure this is staring me in the face, I have the following simple piece of code that if the stock location of the item matches it colours the textbox red.
The item number is pulled from a combobox and it populates all the information but I have a map of the stock locations on a userform made up of textboxes with names that match the stock location.
If they get a match the box colours red.
Im getting type mismatch at the lngRed line? I have used this before? Cant work it out.
Any pointer would be happily accepted.
P
VBA Code:
rivate Sub cmbItemNo_Change()
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Stock")
Me.txtLocation.Value = ws.Range("D" & Me.cmbItemNo.ListIndex + 3).Value
Me.txtPallet.Value = ws.Range("C" & Me.cmbItemNo.ListIndex + 3).Value
Me.txtRack.Value = Left(Me.txtLocation.Value, 1)
Me.txtLevel.Value = Mid(Me.txtLocation.Value, 2, 1)
Me.txtCol.Value = Right(Me.txtLocation.Value, 1)
Dim lngRed As Long
lngRed = RGB(255, 0, 0)
If Me.txtLocation.Value = "G3A" Then
Me.G3A.BackColor = lngRed
End If
End Sub