|
Private Sub Worksheet_Change(ByVal Target As Range)
If Application.Intersect(Target, Range("c3:c65536")) Is Nothing Or Target.Count > 1 Then
Exit Sub
End If
Dim i As Integer
i = 3
Do While Cells(i, "I").Value <> ""
If UCase(Target.Value) = Cells(i, "I").Value Then
Application.EnableEvents = False
Target.Value = Cells(i, "I").Offset(0, 1).Value
Target.Offset(0, -1).Value = Date
Target.Offset(0, 1) = Cells(i, "I").Offset(0, 2).Value
Target.Offset(0, 2) = Cells(i, "I").Offset(0, 3).Value
Target.Offset(0, 3).Select
Application.EnableEvents = True
Exit Sub
End If
i = i + 1
Loop
End Sub
把代码移植到sheet1的vbe窗口中
副本Xl0000006.rar
(10.31 KB, 下载次数: 30)
|
|