Filling array into Combo box

srirajgopinathan

New Member
Joined
Mar 13, 2011
Messages
2
Hi

I am new to this forum, and would like to get help on the usage of array inside a combo.

I am tring to populate a combo box (single coulmn) with an array (dynamically created) . But Iam not sure how to do it. Would like to get get help from this forum

I am trying to get something like 'combobox1.Value=Myarray'

Thanks in advance
Sriraj
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
16,852
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Hi Sriraj,

Welcome to the forum!

If you are using an ActiveX ComboBox, right-click, pick Properties and insert the name of your dynamic range in the text box beside the property ListFillRange.

If you are using a form control in your worksheet, right-click, Format Control, pick the tab Control and insert the name of your dynamic range in the first textbox (Input Range). Choose also a cell as Cell link.

HTH

M.
 

srirajgopinathan

New Member
Joined
Mar 13, 2011
Messages
2
Thanks for the quick response.

I would require the dynamic nature in selecting the range as well.

The row selected for the range would change based on some conditions.

myrange=range(cells(i,j), cells(i,j+c)). Where i, jand c depends on some previous conditions.

Can I give a dynamic range like this in the combo properties?

Is there any way to fill the combobox from the array which has go the data from that range, using VBA code?

Thanks
Sriraj
 

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
16,852
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Hi,

Where is the ComboBox, in a userform or in a worksheet? If in a worksheet is it ActveX or Form control?

M.
 

Forum statistics

Threads
1,141,144
Messages
5,704,541
Members
421,353
Latest member
jekoxien15

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
Top