Adding A String To ComboBox

Chubski

New Member
Joined
Apr 25, 2011
Messages
11
Hello,

Looking for a quick assist on this question please.

I have a userform with a number of comboboxes on.
Of these I have a subset that need to be populated with the same selection options and each individually point to a unique cell on a sheet.

The question is how to create a string of say the standard 5 selections for that subset and at the point the user form is initialised have the string loaded to the specified say 10 comboboxes.

Text 1
Text 2
Text 3
Text 4
Text 5

I don't want to use .additem for each combobox.

I've tried .List and .ListFillRange with the String but no luck.

Thanks & regards

Chubski
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hi

Quick update - think I've managed to solve the issue.
Couldn't really find an easy way to add a string to a combobox.

Instead I found an answer from rorya which helped me by using an array of the required text options within the comboboxes and then adding them to the specific comboboxes with .List before loading / showing the UserForm.

http://www.mrexcel.com/forum/showthread.php?t=361245&highlight=Array+ComboBoxes

Code:
Private Sub FillUserForm()
Dim CBSubData
CBSubData = Array("Text 1","Text2","Text3","Text4","Text5")
UserForm1.ComboBox1.List = CBSubData
UserForm1.ComboBox3.List = CBSubData
UserForm1.ComboBox5.List = CBSubData
UserForm1.ComboBox7.List = CBSubData
UserForm1.Show
End Sub

Cheers

Chubski
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,287
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top