Consulting

Results 1 to 4 of 4

Thread: Solved: Vlook up and two combo boxes

  1. #1
    VBAX Regular
    Joined
    Nov 2006
    Posts
    81
    Location

    Solved: Vlook up and two combo boxes

    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?

  2. #2
    VBAX Regular
    Joined
    Nov 2006
    Posts
    16
    Location
    You have your RowSource property for CBoxTemp set to D5:D25. Delete this value and change your CBoxMat_Change sub to the following:

    [vba]
    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
    [/vba]

    ska

  3. #3
    VBAX Regular
    Joined
    Oct 2005
    Posts
    26
    Location
    Hello Mr.G

    I hope this of some help.

  4. #4
    VBAX Regular
    Joined
    Nov 2006
    Posts
    81
    Location
    Thanx both works equally well.
    Now just to add to the bigger picture.
    Thanx again all.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •