|
不用那么麻烦。- Private Sub Worksheet_Change(ByVal Target As Range)
- Dim xrng As Range
- If Target.Count > 1 Or Target.Row = 1 Then Exit Sub
- col = Target.Column
- If col = 2 Then
- Set xrng = Sheet4.Range("b:b").Find(Target, lookat:=xlWhole)
- If Not xrng Is Nothing Then Target.Offset(0, 2) = xrng.Offset(0, 1)
- Target.Offset(0, 1).Select
- End If
- If col = 3 Then Target.Offset(0, 2).Select
- If col = 1 Or (col >= 5 And col <= 10) Then Target.Offset(0, 1).Select
- If col = 13 Then Cells(Target.Row + 1, 1).Select
- End Sub
复制代码 |
|