+ Reply to Thread
Results 1 to 3 of 3

dynamic combo boxes

  1. #1
    tjb
    Guest

    dynamic combo boxes

    OK, basically what I want is one combo box with three options: "Yes", "No"
    and "Void and Reissue".

    When the user selects "Yes" from the first combo box I want a second combo
    box to appear and have several options to choose from that are unique to the
    "Yes" selection. The options need to by linked to a range of cells (that can
    be updated with a link to another file) on the same sheet.

    If the user selects "No" from the first combo box I want the second combo
    box to appear again and have a different set of options that are unique to
    "No". Again the options need to be linked to a range of cells on the same
    sheet.

    If the user selects "Void and Reissue" then the second combo box will remain
    hidden.

    If the first combo box is cleared the second combo box should be hidden.

    Here's what I've come up with so far:

    Private Sub Deduct_Change()
    'shows user deduction results
    If Deduct.Value = "Yes" Then
    Deduct2.Visible = True
    Deduct2.ListFillRange = "c127:c129"
    End If

    If Deduct.Value = "No" Then _
    Deduct2.Visible = True
    Deduct2.ListFillRange = "c131:c133"
    End If

    If Deduct.Value = "Void and Reissue" Then _
    Deduct2.Visible = False
    End If

    If Deduct.Value = "" Then _
    Deduct2.Visible = False
    End If

    End Sub

    It's not working though. It keeps giving an "End If without Block If" error
    when I try to execute.


  2. #2
    Guest

    dynamic combo boxes

    try this:
    Private Sub Deduct_Change()
    'shows user deduction results
    If Deduct.Value = "Yes" Then
    Deduct2.Visible = True
    Deduct2.ListFillRange = "c127:c129"
    else
    If Deduct.Value = "No" Then
    Deduct2.Visible = True
    Deduct2.ListFillRange = "c131:c133"
    else
    If Deduct.Value = "Void and Reissue" Then
    Deduct2.Visible = False
    else
    If Deduct.Value = "" Then
    Deduct2.Visible = False
    End If
    end if
    end if
    end if
    End Sub

    >-----Original Message-----
    >OK, basically what I want is one combo box with three

    options: "Yes", "No"
    >and "Void and Reissue".
    >
    >When the user selects "Yes" from the first combo box I

    want a second combo
    >box to appear and have several options to choose from

    that are unique to the
    >"Yes" selection. The options need to by linked to a

    range of cells (that can
    >be updated with a link to another file) on the same sheet.
    >
    >If the user selects "No" from the first combo box I want

    the second combo
    >box to appear again and have a different set of options

    that are unique to
    >"No". Again the options need to be linked to a range of

    cells on the same
    >sheet.
    >
    >If the user selects "Void and Reissue" then the second

    combo box will remain
    >hidden.
    >
    >If the first combo box is cleared the second combo box

    should be hidden.
    >
    >Here's what I've come up with so far:
    >
    >Private Sub Deduct_Change()
    >'shows user deduction results
    > If Deduct.Value = "Yes" Then
    > Deduct2.Visible = True
    > Deduct2.ListFillRange = "c127:c129"
    > End If
    >
    > If Deduct.Value = "No" Then _
    > Deduct2.Visible = True
    > Deduct2.ListFillRange = "c131:c133"
    > End If
    >
    > If Deduct.Value = "Void and Reissue" Then _
    > Deduct2.Visible = False
    > End If
    >
    > If Deduct.Value = "" Then _
    > Deduct2.Visible = False
    > End If
    >
    >End Sub
    >
    >It's not working though. It keeps giving an "End If

    without Block If" error
    >when I try to execute.
    >
    >.
    >


  3. #3
    Tim C
    Guest

    Re: dynamic combo boxes

    Try deleting the underscores at the ends of some of your lines.

    Tim C

    "tjb" <[email protected]> wrote in message
    news:[email protected]...
    > OK, basically what I want is one combo box with three options: "Yes", "No"
    > and "Void and Reissue".
    >
    > When the user selects "Yes" from the first combo box I want a second combo
    > box to appear and have several options to choose from that are unique to
    > the
    > "Yes" selection. The options need to by linked to a range of cells (that
    > can
    > be updated with a link to another file) on the same sheet.
    >
    > If the user selects "No" from the first combo box I want the second combo
    > box to appear again and have a different set of options that are unique to
    > "No". Again the options need to be linked to a range of cells on the same
    > sheet.
    >
    > If the user selects "Void and Reissue" then the second combo box will
    > remain
    > hidden.
    >
    > If the first combo box is cleared the second combo box should be hidden.
    >
    > Here's what I've come up with so far:
    >
    > Private Sub Deduct_Change()
    > 'shows user deduction results
    > If Deduct.Value = "Yes" Then
    > Deduct2.Visible = True
    > Deduct2.ListFillRange = "c127:c129"
    > End If
    >
    > If Deduct.Value = "No" Then _
    > Deduct2.Visible = True
    > Deduct2.ListFillRange = "c131:c133"
    > End If
    >
    > If Deduct.Value = "Void and Reissue" Then _
    > Deduct2.Visible = False
    > End If
    >
    > If Deduct.Value = "" Then _
    > Deduct2.Visible = False
    > End If
    >
    > End Sub
    >
    > It's not working though. It keeps giving an "End If without Block If"
    > error
    > when I try to execute.
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1