LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default Excel VBA Drop Down boxes

Not sure what you mean by ambiguous. The problem arises because every time
the user clicks on the combo box the code runs to add items to it. You should
probably create a sub to load the items for each combo box then call it from
the Private Sub UserForm_Initialize

Maybe someting like:

Private Sub popComboBox2
ComboBox2.AddItem ""
ComboBox2.AddItem "NEW_LATE_ENROLLMENT"
ComboBox2.AddItem "LATE_ENROLLMENT"
ComboBox2.AddItem "NEW_ENROLLMENT"
ComboBox2.AddItem "DECREASE"
ComboBox2.AddItem "INCREASE"
ComboBox2.AddItem "PRE_ENROLLMENT"
End Sub

Then you could call it in the initialize:

Private Sub UserForm_Initialize
Call popComboBox2
End Sub

UserForm_Initialize fires once when the form opens, so the combo boxes will
only be populated once.

Repeat the process for each combo box, hope this makes sense.

"Help?" wrote:

Ralph,
This works Great Thanks! However, I have other combo boxes that are doing
the same on the same form. When I try to create another userform, I get the
amiguous error. Any ideas?

"Ralph" wrote:

Place your code under:

Private Sub UserForm_Initialize()
End Sub

Except for this line:
Range("F11") = ComboBox2.Value

leave it where it is, like this:
Private Sub ComboBox2_DropButtonClick()
Range("F11") = ComboBox2.Value
End Sub
"Help?" wrote:

John,
Thanks for the reply:-)

I am populating it, but through code:

Private Sub ComboBox2_DropButtonClick()
ComboBox2.AddItem ""
ComboBox2.AddItem "NEW_LATE_ENROLLMENT"
ComboBox2.AddItem "LATE_ENROLLMENT"
ComboBox2.AddItem "NEW_ENROLLMENT"
ComboBox2.AddItem "DECREASE"
ComboBox2.AddItem "INCREASE"
ComboBox2.AddItem "PRE_ENROLLMENT"
Range("F11") = ComboBox2.Value
End Sub

The drop down gives a list like:
Blank
NEW_LATE_ENROLLMENT
LATE_ENROLLMENT
NEW_ENROLLMENT
DECREASE
INCREASE
PRE_ENROLLMENT

When someone makes a selection the list looks like this:
Blank
NEW_LATE_ENROLLMENT
LATE_ENROLLMENT
NEW_ENROLLMENT
DECREASE
INCREASE
PRE_ENROLLMENT
Blank
NEW_LATE_ENROLLMENT
LATE_ENROLLMENT
NEW_ENROLLMENT
DECREASE
INCREASE
PRE_ENROLLMENT

The more selections that are made, the more it seems to replicate. It's not
connected to any cells except for the selection so that the customer can see
what they have chosen. I looked for a property to keep it from replicating,
but cannot find. Do you know?

I am not sure I understand "paste the code where you are loading it"?




"John Bundy" wrote:

Sounds like you are populating the combobox on the dropdown, if you do that
you must clear it first. If thats not it, paste the code where you are
loading it
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Help?" wrote:

Hello All:
I am a little confused here and can't seem to figure out how this issue can
be resolved. I have created several combo boxes giving customers a list to
choose from, however, when a selection is made the combo box will give the
list again. In other words, the orginal list will show up in multiples when a
selection is made. I have looked at the properties, but cannot find what sets
this action. Can someone help?

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using List Drop Boxes in Excel shellydd Excel Discussion (Misc queries) 1 September 26th 06 02:09 PM
drop down boxes in Excel Bertsinco Excel Programming 1 November 16th 05 10:02 AM
Drop down boxes in Excel colt Excel Discussion (Misc queries) 1 October 3rd 05 07:07 PM
Excel Drop Down Boxes CRS Excel Discussion (Misc queries) 1 September 21st 05 03:45 PM
Drop Down Boxes in Excel Excel Discussion (Misc queries) 2 April 15th 05 01:33 PM


All times are GMT +1. The time now is 11:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"