標題:
[發問]
再對比不相同的資料
[打印本頁]
作者:
john2006168
時間:
2010-7-29 01:28
標題:
再對比不相同的資料
對比不相同的資料,不相同用紅色表示,同時在remark[attach]2052[/attach]注明,請問老師怎麼寫??
作者:
kimbal
時間:
2010-7-29 02:00
本帖最後由 kimbal 於 2010-7-29 02:02 編輯
回復
1#
john2006168
Dim ci, msg
If [e2] = "" Then
Exit Sub
End If
For i = 1 To Range("E1").End(xlDown).Row
If Range("E1").Offset(i) <> Range("E1").Offset(i, 2) Then
msg = "不相符 (miss)"
ci = 3
Else
msg = ""
ci = 0
End If
With Range("E1")
.Offset(i, 1) = msg
.Offset(i, 3) = msg
Range(.Offset(i), .Offset(i, 3)).Interior.ColorIndex = ci
End With
Next
複製代碼
作者:
GBKEE
時間:
2010-7-29 15:13
回復
1#
john2006168
Sub Ex()
Dim i
For i = 2 To Range("E1").End(xlDown).Row
With Range("E1")
If .Cells(i, 1) = .Cells(i, 3) Then
.Cells(i, 1).Resize(, 4).Interior.ColorIndex = 0
Else
.Cells(i, 2) = "不相符(miss)"
.Cells(i, 4) = "不相符(miss)"
.Cells(i, 1).Resize(, 4).Interior.ColorIndex = 3
End If
End With
Next
End Sub
複製代碼
歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)