+ Reply to Thread
Results 1 to 9 of 9

user form drop down box

Hybrid View

  1. #1
    Harald Staff
    Guest

    Re: user form drop down box

    Sure, several ways. You should be able to solve this by now ;-)

    HTH. best wishes Harald

    "Glenn" <me@me.com> skrev i melding
    news:OpiSAVldFHA.4040@TK2MSFTNGP14.phx.gbl...
    > Thanks! Now for my next question -
    >
    > Say I have two (or more combo boxes). Is there a way to make the choices
    > that pop up in the second one dependent upon what was picked in the first
    > one? (For instance if the first one has two choices - "men" and "women",
    > and if you pick "men" only the names of men will come up in combo box 2?




  2. #2
    Glenn
    Guest

    Re: user form drop down box

    Well, I can figure out one way...to make up a user form that has the first
    drop down box in it along with a command button that will load a different
    user form dependent on what was chosen in the first drop down box.

    But, I'd really like this to be all on the same form, to make the process go
    quicker.


    "Harald Staff" <innocent@enron.invalid> wrote in message
    news:u5CCY8ldFHA.1384@TK2MSFTNGP09.phx.gbl...
    > Sure, several ways. You should be able to solve this by now ;-)
    >
    > HTH. best wishes Harald
    >
    > "Glenn" <me@me.com> skrev i melding
    > news:OpiSAVldFHA.4040@TK2MSFTNGP14.phx.gbl...
    >> Thanks! Now for my next question -
    >>
    >> Say I have two (or more combo boxes). Is there a way to make the choices
    >> that pop up in the second one dependent upon what was picked in the first
    >> one? (For instance if the first one has two choices - "men" and "women",
    >> and if you pick "men" only the names of men will come up in combo box 2?

    >
    >




  3. #3
    Harald Staff
    Guest

    Re: user form drop down box

    This solution uses names in Sheet1 A column, and M or F in B column
    indicating male / female.

    Private Sub UserForm_Initialize()
    With Me.ComboBox1
    .Style = fmStyleDropDownList
    .AddItem "Male"
    .AddItem "Female"
    .ListIndex = 1
    End With
    End Sub

    Private Sub ComboBox1_Click()
    Dim R As Long
    ComboBox2.Clear
    Select Case ComboBox1.ListIndex
    Case 0
    For R = 1 To 200
    If Sheets(1).Cells(R, 2).Value = "M" Then _
    ComboBox2.AddItem Sheets(1).Cells(R, 1).Value
    Next
    Case 1
    For R = 1 To 200
    If Sheets(1).Cells(R, 2).Value = "F" Then _
    ComboBox2.AddItem Sheets(1).Cells(R, 1).Value
    Next
    Case Else
    End Select
    End Sub

    HTH. Best wishes Harald

    "Glenn" <nospam@yahoo.com> skrev i melding
    news:un07LNqdFHA.2736@TK2MSFTNGP12.phx.gbl...
    > Well, I can figure out one way...to make up a user form that has the first
    > drop down box in it along with a command button that will load a different
    > user form dependent on what was chosen in the first drop down box.
    >
    > But, I'd really like this to be all on the same form, to make the process

    go
    > quicker.
    >
    >
    > "Harald Staff" <innocent@enron.invalid> wrote in message
    > news:u5CCY8ldFHA.1384@TK2MSFTNGP09.phx.gbl...
    > > Sure, several ways. You should be able to solve this by now ;-)
    > >
    > > HTH. best wishes Harald
    > >
    > > "Glenn" <me@me.com> skrev i melding
    > > news:OpiSAVldFHA.4040@TK2MSFTNGP14.phx.gbl...
    > >> Thanks! Now for my next question -
    > >>
    > >> Say I have two (or more combo boxes). Is there a way to make the

    choices
    > >> that pop up in the second one dependent upon what was picked in the

    first
    > >> one? (For instance if the first one has two choices - "men" and

    "women",
    > >> and if you pick "men" only the names of men will come up in combo box

    2?
    > >
    > >

    >
    >




+ 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