【发布时间】:2015-01-26 00:33:30
【问题描述】:
所以,我有一个任务要求我从两个数据库(.xlsx 格式)中选择一些行,如果(且仅当)任一数据库中的元素值(例如,database1 中的 57 或 database2 中的 38 ) 存在于两个数据库中。所以,我想为每个......下一个循环制作两个,作为
for each x in database1 'and below
for each y in database2
if x=y then '(then I proceed to copy the row in which the x (or y) is located, I figured out a way to do this, this isn't the problem)
Else
End if
Next
Next
不幸的是,我所做的仅允许两个变量之一(在本例中为 y)循环,而 x 停留在一个常量单元格中。
我想知道是否有解决方案,我想同时遍历两个列表,我读过一个问题,但该解决方案适用于另一种编程语言。
【问题讨论】:
-
欢迎来到 Stack Overflow!为了最有效地帮助您解决问题,您能否发布您迄今为止尝试过的代码?
-
and x stays in a constant cell- 不,它没有。它也循环,产生nested loops。