Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default Initiating multiple combo boxes with the same values

Hello,
I have a number of combo boxes on a UserForm all requiring the same values
for hte user to select. Is there an efficient way for me to populate the
select options for each combo box, rather, than initializing each combo box
on the forms initialize event?


--
Carlee
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 373
Default Initiating multiple combo boxes with the same values

If you want the same values in each combobox and you want the same
listindex selection for all, something like this should work:

Private Sub UserForm_initialize()
Dim cmb As ComboBox
For Each cmb In Me.Controls
With cmb
.AddItem "a"
.AddItem "b"
.ListIndex = 1
End With
Next cmb
End Sub

James

On Jun 8, 12:41?am, Carlee wrote:
Hello,
I have a number ofcomboboxeson a UserForm all requiring the same values
for hte user to select. Is there an efficient way for me to populate the
select options for eachcombobox, rather, than initializing eachcombobox
on the forms initialize event?

--
Carlee



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default Initiating multiple combo boxes with the same values

Hi,
So, the errror 'Type mismach 13' is occuring when i click a on my Main Menu
UserForm, to open my StockpileDump data entry form, the form to which i am
trying to initialize. No control source properties contain any data.

Any further suggestions i could test?
--
Carlee


"Zone" wrote:

If you want the same values in each combobox and you want the same
listindex selection for all, something like this should work:

Private Sub UserForm_initialize()
Dim cmb As ComboBox
For Each cmb In Me.Controls
With cmb
.AddItem "a"
.AddItem "b"
.ListIndex = 1
End With
Next cmb
End Sub

James

On Jun 8, 12:41?am, Carlee wrote:
Hello,
I have a number ofcomboboxeson a UserForm all requiring the same values
for hte user to select. Is there an efficient way for me to populate the
select options for eachcombobox, rather, than initializing eachcombobox
on the forms initialize event?

--
Carlee




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 373
Default Initiating multiple combo boxes with the same values

Carlee, Post your entire userform_initialize sub and I'll try to
figure out what's wrong. James

On Jun 8, 4:04?pm, Carlee wrote:
Hi,
So, the errror 'Type mismach 13' is occuring when i click a on my Main Menu
UserForm, to open my StockpileDump data entry form, the form to which i am
trying to initialize. No control source properties contain any data.

Any further suggestions i could test?
--
Carlee



"Zone" wrote:
If you want the same values in each combobox and you want the same
listindex selection for all, something like this should work:


Private Sub UserForm_initialize()
Dim cmb As ComboBox
For Each cmb In Me.Controls
With cmb
.AddItem "a"
.AddItem "b"
.ListIndex = 1
End With
Next cmb
End Sub


James


On Jun 8, 12:41?am, Carlee wrote:
Hello,
I have a number ofcomboboxeson a UserForm all requiring the same values
for hte user to select. Is there an efficient way for me to populate the
select options for eachcombobox, rather, than initializing eachcombobox
on the forms initialize event?


--
Carlee- Hide quoted text -


- Show quoted text -



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default Initiating multiple combo boxes with the same values

Hi,
I tried to implement this, i keep getting a 'data mismatch' error. How can
i resolve this?
--
Carlee


"Carlee" wrote:

Hello,
I have a number of combo boxes on a UserForm all requiring the same values
for hte user to select. Is there an efficient way for me to populate the
select options for each combo box, rather, than initializing each combo box
on the forms initialize event?


--
Carlee



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 373
Default Initiating multiple combo boxes with the same values

Carlee, it worked fine for me. Did you copy and paste? Are you using
Excel XP (2002 or 2003)? Also, be sure the Control Source property is
set to empty. James

On Jun 8, 1:28?pm, Carlee wrote:
Hi,
I tried to implement this, i keep getting a 'data mismatch' error. How can
i resolve this?
--
Carlee



"Carlee" wrote:
Hello,
I have a number of combo boxes on a UserForm all requiring the same values
for hte user to select. Is there an efficient way for me to populate the
select options for each combo box, rather, than initializing each combo box
on the forms initialize event?


--
Carlee- Hide quoted text -


- Show quoted text -



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
Getting Combo boxes to change options based on other Combo boxes. Ancient Wolf New Users to Excel 1 March 27th 09 06:29 PM
multiple combo boxes jeff Excel Discussion (Misc queries) 2 December 16th 08 05:02 PM
multiple combo boxes LilyDog7 Excel Discussion (Misc queries) 4 October 17th 05 10:22 PM
Linking multiple combo boxes Subs Excel Programming 4 May 19th 05 12:52 AM
Checking values already in combo boxes Dean Knox[_3_] Excel Programming 2 November 28th 03 02:15 PM


All times are GMT +1. The time now is 09:24 AM.

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"