+ Reply to Thread
Results 1 to 2 of 2

ComboBox Issues

Hybrid View

  1. #1
    Darrin Henshaw
    Guest

    ComboBox Issues

    Sorry if this is a duplicate, but it didn't seem to post the first time:

    I'm having another ComboBox issue. The good thing about a combobox is
    that the user has the ability to enter their own answer, when the ones
    presented do not match what they need, which is why I'm using one.
    My ComboBox has 4 options presented to the user. The ComboBox.Value of
    the first option is 0, and the next is 1 etc. Now, what would be the
    value of the ComboBox if the user enters in their own info. I'm using
    the ComboBox.Value to determine the contents of one cell, and can get it
    to work for the four options I give them, but if they put in their own
    stuff, I can't get that info to populate into the cell. My code is as
    follows:

    Private Sub Contract1_Enter()
    ComboBox1.DropDown
    ComboBox1.AddItem "Option 1"
    ComboBox1.AddItem "Option 2"
    ComboBox1.AddItem "Option 3"
    ComboBox1.AddItem "Option 4"
    'Use drop-down list
    ComboBox1.Style = fmStyleDropDownCombo
    'Combo box values are ListIndex values
    ComboBox1.BoundColumn = 0
    'Set combo box to first entry
    ComboBox1.ListIndex = 0

    End Sub

    Then in a command button I have this:
    If Contract1.Value = 0 Then ActiveWorkbook.Worksheets
    _("Sheet1").Range("E20") = "Option 0"
    If Contract1.Value = 1 Then ActiveWorkbook.Worksheets
    _("Sheet1").Range("E20") = "Option 1"
    If Contract1.Value = 2 Then ActiveWorkbook.Worksheets
    _("Sheet1").Range("E20") = "Option 2"
    If Contract1.Value = 3 Then ActiveWorkbook.Worksheets
    _("Sheet1").Range("E20") = "Option 3"

    Any ideas?


    *** Sent via Developersdex http://www.developersdex.com ***

  2. #2
    Tom Ogilvy
    Guest

    Re: ComboBox Issues

    See answer to your first posting.

    --
    Regards,
    Tom Ogilvy


    "Darrin Henshaw" <dhenry@psigphp.com> wrote in message
    news:OtmK3zkQFHA.2680@TK2MSFTNGP09.phx.gbl...
    > Sorry if this is a duplicate, but it didn't seem to post the first time:
    >
    > I'm having another ComboBox issue. The good thing about a combobox is
    > that the user has the ability to enter their own answer, when the ones
    > presented do not match what they need, which is why I'm using one.
    > My ComboBox has 4 options presented to the user. The ComboBox.Value of
    > the first option is 0, and the next is 1 etc. Now, what would be the
    > value of the ComboBox if the user enters in their own info. I'm using
    > the ComboBox.Value to determine the contents of one cell, and can get it
    > to work for the four options I give them, but if they put in their own
    > stuff, I can't get that info to populate into the cell. My code is as
    > follows:
    >
    > Private Sub Contract1_Enter()
    > ComboBox1.DropDown
    > ComboBox1.AddItem "Option 1"
    > ComboBox1.AddItem "Option 2"
    > ComboBox1.AddItem "Option 3"
    > ComboBox1.AddItem "Option 4"
    > 'Use drop-down list
    > ComboBox1.Style = fmStyleDropDownCombo
    > 'Combo box values are ListIndex values
    > ComboBox1.BoundColumn = 0
    > 'Set combo box to first entry
    > ComboBox1.ListIndex = 0
    >
    > End Sub
    >
    > Then in a command button I have this:
    > If Contract1.Value = 0 Then ActiveWorkbook.Worksheets
    > _("Sheet1").Range("E20") = "Option 0"
    > If Contract1.Value = 1 Then ActiveWorkbook.Worksheets
    > _("Sheet1").Range("E20") = "Option 1"
    > If Contract1.Value = 2 Then ActiveWorkbook.Worksheets
    > _("Sheet1").Range("E20") = "Option 2"
    > If Contract1.Value = 3 Then ActiveWorkbook.Worksheets
    > _("Sheet1").Range("E20") = "Option 3"
    >
    > Any ideas?
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***




+ 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