PDA

View Full Version : Solved: Vlook up and two combo boxes



Mr.G
01-09-2007, 06:39 AM
Hi all
My problem is as follows, in the example I had 0-100 for a temperature on all three the materials, but it needs to change so that you only have a certain range for a certain material.
So if you select water it must give you 0-100 but if you select salt water it must only give you 0-50 and for oil it must give 55-100.
See attached.....

Could someone assist?

ska67can
01-09-2007, 09:15 AM
You have your RowSource property for CBoxTemp set to D5:D25. Delete this value and change your CBoxMat_Change sub to the following:


Private Sub CboxMat_Change()
If CboxMat.Value = "Sea Water" Then
CboxTemp.RowSource = "D5:D25"
ElseIf CboxMat.Value = "Water" Then
CboxTemp.RowSource = "H16:H25"
ElseIf CboxMat.Value = "Oil" Then
CboxTemp.RowSource = "L5:L16"
End If
If Me.CboxTemp.ListIndex <> -1 Then
GetLookupValues
End If
End Sub


ska

benny
01-09-2007, 09:38 AM
Hello Mr.G

I hope this of some help.

Mr.G
01-09-2007, 10:45 PM
Thanx both works equally well.
Now just to add to the bigger picture.
Thanx again all.