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

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
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,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

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