点击文件名下载附件
Sub 宏A3()
Dim A As Byte, B As Byte, C As Byte
For i = 1 To Range("A46").End(xlToRight).Column '循环 1 到 使用的最大列
For A = 25 To 34
For B = 36 To 45
If (Cells(A, i) = 4 Or Cells(A, i) = 0) And (Cells(B, i) = 1 Or Cells(B, i) = 3) Then Cells(47, i) = Cells(A, i)
If (Cells(A, i) = 4 Or Cells(A, i) = 0) And (Cells(B, i) = 1 Or Cells(B, i) = 3) Then Cells(48, i) = Cells(B, i)
Next
Next
Next
End Sub
这段代码,为什么当Cells(A, i) =0 或者 当Cells(B, i) =0 的时候,选出的结果就会出错误,连空格都选出来了!