|
dear 亲爱的大神们
因为是刚学VBA,自己写了个简单的程序,希望有大神能帮忙简化一下,好参考一下。
感觉自己写的非常的复杂,很罗嗦。{:091:}
结果放在第5列,方便比对 - Sub Macro1()
- For i = 1 To Range("b65536").End(xlUp).Row
- If Cells(i, 1) = Cells(i, 3) Then
- If Cells(i, 1) <> "" Then
- Cells(i, 5) = Cells(i, 2)
- Else
- n = Cells(i, 1).End(xlUp).Row
- If Cells(n, 1) = Cells(n, 3) Then Cells(i, 5) = Cells(i, 2)
- End If
- End If
- Next
- End Sub
复制代码
|
|