Private Sub Worksheet_Change(ByVal Target As Range)
If Target.CountLarge > 1 Or Intersect([i2:k2], Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
Cells(2, 21 - Target.Column) = ""
Application.EnableEvents = True
Dim rg As String
Private Sub Worksheet_SelectionChange(ByVal Target As Range) '选取单元格准备修改时记录原单元格值
If Target.Address(0, 0) Like "[I-K]2" Then rg = Target.Value Else Exit Sub
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.CountLarge > 1 Or Intersect([i2:k2], Target) Is Nothing Then Exit Sub
If Len(rg) = 0 Or Target.Value = rg Then Exit Sub '如果原单元格为空或者相同退出
Application.EnableEvents = False
rg = Target.Value
[i2:k2] = ""
Target = rg
Application.EnableEvents = True
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.CountLarge > 1 Or Intersect([i2:k2], Target) Is Nothing Then Exit Sub
dim s$
s=target
Application.EnableEvents = False
[i2:k2] = ""
target=s
Application.EnableEvents = True