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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
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,214,924
Messages
6,122,294
Members
449,077
Latest member
Rkmenon

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