Consulting

Results 1 to 2 of 2

Thread: Solved: Combo Box Reading InCorrect Selection

  1. #1

    Solved: Combo Box Reading InCorrect Selection

    Hi,

    I am trying to utilize a combo box that is just placed in an excel worksheet.

    I have two selection options in the combo box:
    A. "Business Optimization"
    B. "Feedstock Optimization"

    The issue that I am having is that if I have "Business Optimization" or "Feedstock Optimization" selected when the workbook is opened or when I select the same selection; ie select Business Optimization right Business Optimization or select Feedstock Optimization right after Feedstock Optimization; the 2nd selection doesn't seem to register in vba.

    Initially I used the "CHANGE EVENT" for the combo box but then I chose to use the "CLICK EVENT" for the combo box.

    Of the event handlers:

    Click, DblCLick, DropButtonClick, Error, Got Focus, KeyDown, KeyPress, KeepUp, LostFocus,MouseDown, mouseMove, MouseUp, BeforeDragover, beforedroporpaste, Change


    The current code I have is the following:

    [vba]
    Private Sub cmd_busoptMode_Click()
    If Sheets("Overview").cmd_busoptMode.Value = "Business Optimization" Then
    BusOptMode = True
    MsgBox "I'm in Max mode, Bus Opt Mode is:" & BusOptMode
    ElseIf Sheets("Overview").cmd_busoptMode.Value = "Feedstock Optimization" Then
    BusOptMode = False
    MsgBox "I'm in Max mode, Bus Opt Mode is:" & BusOptMode
    Else
    MsgBox "Select Business Optimization or Feedstock Optimization"
    End If
    End Sub

    [/vba]

    Any advice is appreciated.

  2. #2
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    I have already responded to the cross-post at:
    http://www.mrexcel.com/forum/showthread.php?t=340727

Posting Permissions

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