M
mtorres.f
Hi everyone, Im really new at this and Im working with a collection.
I want to simplify it:
This is part of the code
Set nuevoactivo = New Activo
nuevoactivo.Codigo = Sheets("Cartera SII").Cells(k, 1)
nuevoactivo.sFPG000015 = Cells(i,j)
nuevoactivo.sFPG000632 = Cells(i,j)
nuevoactivo.sFIG002826 = Cells(i,j)
nuevoactivo.sFIG002827 = Cells(i,j)
nuevoactivo.sFIG002852 = Cells(i,j)
nuevoactivo.sFIB002233 = Cells(i,j)
nuevoactivo.sFIH002231 = Cells(i,j)
nuevoactivo.sFPG001144 = Cells(i,j)
....
.....
.....
.....
mlistaactivos.Add nuevoactivo, nuevoactivo.Codigo
an I also have an array with the codes:
Fondos(1)=FPG000015
Fondos(2)=FPG000632
Fondos(3)=FIG002826
Fondos(4)=FIG002827
Fondos(5)=FIG002852
Fondos(6)=FIB002233
......
......
I tryed to do the following but it doesn´t work:
For i=1 to n
For j= 1 to n
nuevoactivo.s & Fondos(i)= cells(i,j)
next j
next i
Any idea? I really appreciate it!!
I want to simplify it:
This is part of the code
Set nuevoactivo = New Activo
nuevoactivo.Codigo = Sheets("Cartera SII").Cells(k, 1)
nuevoactivo.sFPG000015 = Cells(i,j)
nuevoactivo.sFPG000632 = Cells(i,j)
nuevoactivo.sFIG002826 = Cells(i,j)
nuevoactivo.sFIG002827 = Cells(i,j)
nuevoactivo.sFIG002852 = Cells(i,j)
nuevoactivo.sFIB002233 = Cells(i,j)
nuevoactivo.sFIH002231 = Cells(i,j)
nuevoactivo.sFPG001144 = Cells(i,j)
....
.....
.....
.....
mlistaactivos.Add nuevoactivo, nuevoactivo.Codigo
an I also have an array with the codes:
Fondos(1)=FPG000015
Fondos(2)=FPG000632
Fondos(3)=FIG002826
Fondos(4)=FIG002827
Fondos(5)=FIG002852
Fondos(6)=FIB002233
......
......
I tryed to do the following but it doesn´t work:
For i=1 to n
For j= 1 to n
nuevoactivo.s & Fondos(i)= cells(i,j)
next j
next i
Any idea? I really appreciate it!!