How to transform a String variable in another variable

  • Thread starter Thread starter mtorres.f
  • Start date Start date
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??
 
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??
 
Back
Top