是指两列中相同的数,如:A列与I列从下往上看第一个相同的数就是432。I列与M列从下往上看第一个相同的数是874,两列中相同的数不止一个,只要从下往上看的第一个就行了,行号不必相同。
追答Sub x()
Dim a%, i%, m%
For a = 607 To 2 Step -1
For i = 607 To 2 Step -1
If Cells(a, 1) = Cells(i, 9) Then
[h607] = Cells(a, 1)
GoTo 0
Next
Next
0:
For i = 607 To 2 Step -1
For m = 607 To 2 Step -1
If Cells(i, 9) = Cells(m, 13) And Cells(i, 9) [a607] Then
[h606] = Cells(i, 9)
End Sub
Next
Next
End Sub
运行代码时,错误:NexT没有FOR。
追答Sub x()
Dim a%, i%, m%
For a = 607 To 2 Step -1
For i = 607 To 2 Step -1
If Cells(a, 1) = Cells(i, 9) Then
[h607] = Cells(a, 1)
GoTo 0
endif
Next
Next
0:
For i = 607 To 2 Step -1
For m = 607 To 2 Step -1
If Cells(i, 9) = Cells(m, 13) And Cells(i, 9) [a607] Then
[h606] = Cells(i, 9)
exit Sub
endif
Next
Next
End Sub
不行,不能按要求找到数。
追答我已经测试过的,如果还不行那肯定是你描述问题
追问我试了,条件2中的要不含有A607中任何一个数字没有满足。你在A607中改为156,I列和M列都改一个219。结果219提出来了,而219含有1,5,6中的一个数字1,是不合要求的。
追答晕,你的a607都拆成一个一个的数字来看?
那太麻烦了,懒得给你写了,自己改改吧