Rowsource in combobox

kelly mort

Well-known Member
Joined
Apr 10, 2017
Messages
2,169
Office Version
  1. 2016
Platform
  1. Windows
Hello,
I want to load my comboboxes dynamically.

I have four comboxes and I am loading them with I rowsource.

What I want to do now is that, when I select an item from the first combobox, then inside the second combobox, show the list from the first combobox except the one selected in the first combobox . Then inside the third combobox, show the list from the second combobox except the one selected from the second combobox etc.

I hope this is achievable.

Thanks

Kelly
 
Re: Rowsource in combobox challenge

Here are two example of Arrays

Code:
Private Sub CommandButton2_Click()
ComboBox1.List = Array("One", "Ten", "Twelve")
ComboBox1.List = Array(Cells(1, 1).Value, Cells(5, 1).Value, Cells(7, 1).Value)
End Sub
Oh great can you explain what the above lines are actually doing please?

Regards
Kelly
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Re: Rowsource in combobox challenge

They are loading values into your Combobox

The first example loads "One" and "Ten" and "Twelve" into your combobox

Or if you wanted to load cell values into your combobox you can use the second example.
 
Upvote 0
Re: Rowsource in combobox challenge

Okay nice so with the first one, if I want to swap those list for another like I do for the rowsource by setting
ComboBox1.Rowsource = "", how will that be done?
Regards
Kelly
 
Upvote 0
Re: Rowsource in combobox challenge

These are the two example:

Code:
ComboBox1.RowSource = "A1:A20"
ComboBox1.List = Range("A1:A20").Value


My First example would normally only be used for a small amount of values.
Unless you want to enter 20 more values Like "Apple" "Cake" "Pie"

But there are ways to use arrays to do a lot more things. I'm not sure how to do what is know as two dimensional arrays.
 
Last edited:
Upvote 0
Re: Rowsource in combobox challenge

Okay thanks a lot for the time.

I will be back here again when I get tougher challenge
 
Upvote 0
Re: Rowsource in combobox challenge

Wow that's a lot of information for me there. I am grateful for it.

Thanks
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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