VBA for changing the RowSource Range on a ComboBox Excel 2010

Maccus77

New Member
Joined
Dec 22, 2015
Messages
4
I'm stumped. I have read threads and tried solutions for changing the RowSource property of a ComboBox using VBA.

I can type the Lookup!RangeName into the Properties box and it all works fine. But when I try something along the lines of UserForm.ComboBox.RowSource="Lookup!RangeName" nothing happens. I type it into the _Change parameter of the ComboBox and have tried other variants but nothing happens.

From other reading, I assume the Property RowSource input is an Initialise event but this doesn't help me much and I need to concatenate two sources into the single ComboBox. I will also need to make subsequent ComboBoxes dynamic so I could really use a few pointers as how to get past the first hurdle.

I expect I'm doing something daft, but any help would be welcomed.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi Maccus77,

Try,

Code:
[FONT="Consolas"][SIZE="2"][COLOR="Navy"]UserForm.ComboBox.RowSource=Range("Lookup!RangeName").Address[/COLOR][/SIZE][/FONT]
 
Upvote 0
Many thanks Mohammed. That works. Also, what I had not been doing was putting it in the UserForm Initialise part of the VBA. :)
 
Upvote 0

Forum statistics

Threads
1,216,514
Messages
6,131,105
Members
449,619
Latest member
AntoineMaubon

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