How to transform a String variable in another variable

M

mtorres.f

Hi, Im really new at this, I need yout help to solve this.

mlistaactivos is a collection, vector Fondos is an Array and i need to
dynamically "fill" it, but the code below doesn´t work


mlistaactivos.s & VectorFondos(i)

any idea??
 
B

Brendan Reynolds

Do you mean that you want to copy the values from the collection to the
array? If so ...

Public Sub TestSub()

Dim col As Collection
Dim avar() As Variant
Dim lngLoop As Long

'Fill the collection ...
Set col = New Collection
For lngLoop = 1 To 10
col.Add lngLoop, CStr(lngLoop)
Next lngLoop

'Copy the collection to the array ...
ReDim avar(col.Count - 1)
For lngLoop = 0 To col.Count - 1
avar(lngLoop) = col(lngLoop + 1)
Next lngLoop

'List the values in the array ...
For lngLoop = LBound(avar) To UBound(avar)
Debug.Print avar(lngLoop)
Next lngLoop

End Sub

--
Brendan Reynolds
Access MVP

Hi, Im really new at this, I need yout help to solve this.

mlistaactivos is a collection, vector Fondos is an Array and i need to
dynamically "fill" it, but the code below doesn´t work


mlistaactivos.s & VectorFondos(i)

any idea??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top