PDA

View Full Version : Solved: Combo Box Reading InCorrect Selection



dlssargent
09-09-2008, 06:33 PM
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:


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 Optimiz
ation"
End If
End Sub


Any advice is appreciated.