|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
'''C列和M列对比;E列和O列对比;
'''D列和N列对;G列和P列对比,
'''将不同的数据用颜色标记
Sub 数据对比()
r = Range("C99999").End(3).Row
Range("M3:Q" & r).Interior.Color = xlNone
For i = 3 To r
If Cells(i, "C") <> Cells(i, "M") Then Cells(i, "M").Interior.Color = vbYellow
If Cells(i, "E") <> Cells(i, "O") Then Cells(i, "O").Interior.Color = vbYellow
If Cells(i, "D") <> Cells(i, "N") Then Cells(i, "N").Interior.Color = vbYellow
If Cells(i, "G") <> Cells(i, "P") Then Cells(i, "P").Interior.Color = vbYellow
Next i
End Sub
|
|