Subscript out of Range when Populating Combobox from One Dimensional Array

Hmerman

Board Regular
Joined
Oct 2, 2016
Messages
102
Hello,
I have a Combobox on a Userform that I want to populate with a Dynamic One Dimensional Array that currently has 26 elements. But the .List method gives me a Subscript Out of Range error.

My code:
Code:
cbVragVerwysing.List = NewArr(tempCntr)

Can someone please give me advice or help on how to make it work?

Regards,
Herman
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Hello,
I have a Combobox on a Userform that I want to populate with a Dynamic One Dimensional Array that currently has 26 elements. But the .List method gives me a Subscript Out of Range error.

My code:
Code:
cbVragVerwysing.List = NewArr(tempCntr)
NewArr is the array of data correct? If so, just assign the array directly...

cbVragVerwysing.List = NewArr
 
Last edited:
Upvote 0
NewArr is the array of data correct? If so, just assign the array directly...

cbVragVerwysing.List = NewArr
You are brilliant. Thank you.

Yes, you are correct NewArr is the array of the data. I did as you said and it worked perfectly.

Thanks again.

Regards,
 
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