I have a sheet that has two columns in it, A and B. A has part numbers and B has quantities. I have populated my part numbers into a ComboBox on a UserForm and, at least this is what I think is the best way to do it, I want to use the .ListIndex of that ComboBox to then get the value from the column B in the worksheet so that I can populate another ComboBox. So as an example if the .ListIndex is 4, then I want to get the value of B4 into my VBA as an Integer so I can use that value to populate my second ComboBox. Which will end up being 1-FoundIntegerValue.
VBA Code:
Private Sub PartNumberBox_Change()
Dim Max As Integer
If PartNumberBox.ListIndex <> -1 Then
QuantityBox.Visible = True
JobNumberBox.Visible = True
Else
QuantityBox.Visible = False
JobNumberBox.Visible = False
End If
Max = Worksheets("OnHand").Cell("B" & PartNumberBox.ListIndex).Offset(1)
End Sub