How to loop the array in the same time in VBA

51 views Asked by At

My problem is after the the j in the loop is done, the i will just move.

I want to the run the 2 loop array at the same time.

ReDim ArrayItems(Download_frm.ListBox1.ListCount)
ReDim ArrayItems1(Download_frm.accountb.ListCount)

For i = 1 To Download_frm.ListBox1.ListCount
   Download_frm.ListBox1.ListIndex = i - 1
   ArrayItems(i) = Download_frm.ListBox1.Text
 
   MsgBox ArrayItems(i)
   'myarray = ArrayItems(i)
 
 
   For j = 1 To Download_frm.accountb.ListCount
      Download_frm.accountb.ListIndex = j - 1
      ArrayItems1(j) = Download_frm.accountb.Text
 
      MsgBox ArrayItems1(j)
      'MsgBox ArrayItems1(j)

      accountli = ArrayItems1(j)
 
      'MsgBox ArrayItems(i)
 
      COCODELI = ArrayItems(i)
   Next j
Next i
0

There are 0 answers