Loading array of dynamic to ComboBox?
Hi All :wave:
So, I want to make:
I have array one-dimension of data. Load this data to combobox. But I want have the array of dynamic.
I know how to load this array to combobox e.g.
VB Code:
For lTemp = LBound(sArray) To UBound(sArray)
Combo1.Additem sArray(lTemp)
Next lTemp
However I want to be able adding the new of data - therefore the array of dynamic.
So.... how I should to declare the array of dynamic? about what I should to remember and about what I can't forget.
I know that I should use keyword ReDim, I don't know unfortunately how to do.
Some example code can to explain me many here
Thanks in advance
Re: Loading array of dynamic to ComboBox?
VB Code:
Dim sArray() As String 'Declare
Redim sArray(2) 'Redim for 3 Items (0 to 2)
sArray(0) = "1"
sArray(1) = "2"
sArray(2) = "3"
Redim Preserve sArray(3) 'Redim Preserve 1 more position
sArray(3) = "4"
'Or Redim Preserve at the end, no matter how many items it has..
ReDim Preserve sArray(UBound(sArray) + 1)
sArray(UBound(sArray)) = "5"