Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 7 Then
roww = Target.Row
If Application.WorksheetFunction.CountIf(Range("g1:g" & roww), Target.Value) <> 1 Then
MsgBox "重複批號"
Target.Interior.ColorIndex = Application.WorksheetFunction.RandBetween(1, 50)
Else
Exit Sub
End If
End If
End Sub作者: PD961A 時間: 2010-7-7 11:29