微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在VBA中同时循环数组

如何解决如何在VBA中同时循环数组

我的问题是循环中的j完成后,i将会移动。

我想同时运行2循环数组。

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。