小编Reg*_*son的帖子

Python 的 Zip 函数的 VBA 版本(FOR EACH 循环)

在 Python 中,我可以使用 zip 函数一次遍历多个列表。我将如何在 Excel 中的 VBA 中的宏中执行此操作?

伪代码

Set ones = Worksheets("Insertion").Range("D2:D673")
Set twos = Worksheets("Insertion").Range("A2:A673")
Set threes = Worksheets("Insertion").Range("B2:B673")
Set fours = Worksheets("Insertion").Range("C2:C673")

For Each one, two, three, four in zip(ones.Cells, twos.Cells, threes.Cells, fours.Cells)
    Debug.Print(one.Text & two.Text & three.Text & four.Text)
Next one
Run Code Online (Sandbox Code Playgroud)

python excel vba loops

3
推荐指数
1
解决办法
1143
查看次数

标签 统计

excel ×1

loops ×1

python ×1

vba ×1