Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default Adding items to a combo box

Hello,

I've got a combo box on a form, and I'm trying to add items to it;
however, the items are not showing up - I believe I'm missing a step.
I've got the following in the code for the combo box right now:

Private Sub cbWhatToProcess_Change()
cbWhatToProcess.AddItem "Draft"
cbWhatToProcess.AddItem "Final"
cbWhatToProcess.AddItem "Other"
cbWhatToProcess.AddItem "Signature Pages"
cbWhatToProcess.AddItem "Regular PDF"
cbWhatToProcess.AddItem "Special PDF"
cbWhatToProcess.AddItem "Colored Graphs"

End Sub

I also want to be able to select multiple items from the list, so is
there anything special I need to do in order to do that? Thanks.

Frank
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default Adding items to a combo box

I am unsure of how to select more than one item from the list at a time...


But to fix your first problem... you need to encase your code into a module
the will run when the userform initializes.

Private Sub UserForm_Initialize()
cbWhatToProcess.AddItem "Draft"
cbWhatToProcess.AddItem "Final"
cbWhatToProcess.AddItem "Other"
cbWhatToProcess.AddItem "Signature Pages"
cbWhatToProcess.AddItem "Regular PDF"
cbWhatToProcess.AddItem "Special PDF"
cbWhatToProcess.AddItem "Colored Graphs"
End Sub

"Phrank" wrote in message
...
Hello,

I've got a combo box on a form, and I'm trying to add items to it;
however, the items are not showing up - I believe I'm missing a step.
I've got the following in the code for the combo box right now:

Private Sub cbWhatToProcess_Change()
cbWhatToProcess.AddItem "Draft"
cbWhatToProcess.AddItem "Final"
cbWhatToProcess.AddItem "Other"
cbWhatToProcess.AddItem "Signature Pages"
cbWhatToProcess.AddItem "Regular PDF"
cbWhatToProcess.AddItem "Special PDF"
cbWhatToProcess.AddItem "Colored Graphs"

End Sub

I also want to be able to select multiple items from the list, so is
there anything special I need to do in order to do that? Thanks.

Frank



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Adding items to a combo box

If you want multiple selections, then using a combobox would be the wrong
control. Use a listbox instead.

I would say don't use the Change event to populate the Combobox. If you
look at the events of the userform, there are the Initialize events and the
Activate event which might be a more useful place to populate the Combobox.

--
Regards,
Tom Ogilvy

"Phrank" wrote in message
...
Hello,

I've got a combo box on a form, and I'm trying to add items to it;
however, the items are not showing up - I believe I'm missing a step.
I've got the following in the code for the combo box right now:

Private Sub cbWhatToProcess_Change()
cbWhatToProcess.AddItem "Draft"
cbWhatToProcess.AddItem "Final"
cbWhatToProcess.AddItem "Other"
cbWhatToProcess.AddItem "Signature Pages"
cbWhatToProcess.AddItem "Regular PDF"
cbWhatToProcess.AddItem "Special PDF"
cbWhatToProcess.AddItem "Colored Graphs"

End Sub

I also want to be able to select multiple items from the list, so is
there anything special I need to do in order to do that? Thanks.

Frank



Reply
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
Adding items to a combo box on a user form Gazz_85[_2_] Excel Discussion (Misc queries) 1 July 9th 09 05:00 PM
Adding Items To a combo Box LoveCandle[_28_] Excel Programming 4 April 7th 06 09:58 PM
add items to combo box beauty_bobaloo Excel Programming 4 March 17th 06 09:24 AM
Adding Items to a ListBox-Unique Items Only jpendegraft[_14_] Excel Programming 2 May 2nd 04 02:27 AM
Different colors for combo items Malcolm Excel Programming 1 November 6th 03 12:26 PM


All times are GMT +1. The time now is 03:23 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"