VBA Userform drop down list appears blank

Ge11i

New Member
Joined
Dec 15, 2016
Messages
1
*I’m very new to VB, so I apologise in advance!
I’ve created my first userform for excel, want participants to enter their data, click ‘submit’ and excel will store the data on one of the sheets. Made drop down lists with a combo box, but when the user form opens automatically with the excel document, it the value appear blank? (see below) and is the same for all the boxes on the form.
[TABLE="align: left"]
<tbody>[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]
C:\DOCUME~1\He083659\LOCALS~1\Temp\msohtmlclip1\01\clip_image002.jpg
[/TD]
[/TR]
</tbody>[/TABLE]


This is the code I use for the drop down box:
Private Sub UserForm_Activate()
ComboContrib.AddItem 'Consent & Surgical Intervention', 0
ComboContrib.AddItem 'Consent & Patient Care', 1
ComboContrib.AddItem 'Patient Care & Data Aquisition', 2
ComboContrib.AddItem 'Other', 3
End Sub

Any ideas to why this is happening? Thank you.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
If your code is as shown, you need double quote marks (rather than single) to indicate a string. A single quote mark (except if inside starting/ending double quote marks) indicates that the rest of the line is a comment and is ignored by the compiler.

Hope that helps,

Mark
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,906
Members
452,366
Latest member
TePunaBloke

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