i would helping to adjust my code i have data in my sheet a,b ,c columns a= item , b= brand, c= quantity and userform textbox1,2,3
when i fill the data in textbox2 the brand and textbox 3 the quantity and press enter in textbox3 should show message "available is 330 or 500...etc" if what i fill the value in texbox3 more than what contains in column c "
my code when i choose the brand an fill value it continues give me the same value in the first brand in column c
Private Sub TextBox3_AfterUpdate() Dim myCell As Range
For Each myCell In Range("c2:c4") If TextBox3.Value > myCell Then MsgBox " the availble brand is " & myCell.Value, vbOKOnly Exit Sub End If Next myCell End Sub
i ment textbox3 the Quantity not brand with column c i change this line to :
therange = "B" & a it show the quantity but there is problem it shows the quantity of number 200 every time i choose the new brand!