Combobox Number Entry.

d34n0

Board Regular
Joined
Jun 28, 2004
Messages
121
I have a combobox in a userform used to record the floor/level number (G, 1, 2, 3 etc). Is it possible to write the code any other way than have 12 different lines of ".additem" code for each 1 to 12 number entries representing the floor number?

Thanks
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi

Perhaps something like this:

Code:
Private Sub UserForm_Initialize()
With Me.ComboBox1
    .List = Range("A1:A10").Value
End With
End Sub
 
Upvote 0
maybe something like

Code:
.AddItem = "G"

For Floor = 1 To 12
    .AddItem = Floor
Next Floor
 
Upvote 0
The loop solution is kind of what I had in mind but i just failed to get the format right.

Thank you all for your help :)

Regards

D34n0
 
Upvote 0

Forum statistics

Threads
1,207,173
Messages
6,076,923
Members
446,242
Latest member
JECYN

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