rowsource field in properties

glennjrobertson1980

New Member
Joined
Mar 30, 2015
Messages
12
Hi,

Hope somebody can help me. I am using Excel 2007.

I am creating a userform, the only object on this userform is a combo box. When i click on the combo box in the properties within VBA I have RowSource i am completing this as I normally would with - 'sheet1'!B11:B16
when i click on the drop down for the combo box it shows the source data as it should.

I then have a macro on my spreadsheet that when clicked shows the userform.

However when the form loads there is no information in the combo box and when I go back into VBA and click on the combo box and look in properties the RowSource field has totally disappeared...

Please can somebody help.....
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
What happens if you set the RowSource in the userform Initlalize event?
Code:
Private Sub UserForm_Initialize()
    ComboBox1.RowSource = "'Sheet1'!B11:B16"
End Sub
Or use List instead.
Code:
Private Sub UserForm_Initialize()
    ComboBox1.RowSource = ""
    ComboBox1.List = Sheets("Sheet1").Range("B11:B16").Value
End Sub
 
Upvote 0
Did you change ComboBox1 to the name of your combobox?
 
Upvote 0
Where did you put the code?

It belongs in the userform module and will be triggered when the userform is loaded.
 
Upvote 0
If I create a userform, add a combobox, add the code I posted in the userform module I can't replicate any of the errors you describe.

Could you upload a sample file to a file sharing site like Box.net?
 
Upvote 0
When I do this in Excel 2003 it works fine, its only when I do it in Excel 2007 is when I have the issue.

Also can't explain why the rowsource property box is actually disappearing form the properties menu with VBA
 
Upvote 0
If you goto Tools>References... is anything marked as missing?

Does the code work if you try if you start over in a blank workbook? ie open a new workbook, add a userform, combobox etc
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,376
Members
449,080
Latest member
Armadillos

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