|
- Private Sub Worksheet_Change(ByVal Target As Range)
- Dim irow&, rng As Range
- If Target.Count = 1 Then
- If Target.Column = 1 Then
- With Sheets("合同资料")
- Set rng = .Columns(1).Find(Target.Value, , xlValues, xlWhole)
- If Not rng Is Nothing Then
- irow = rng.Row
- Target.Offset(, 1).Resize(, 5) = .Range("B" & irow & ":F" & irow).Value
- Else
- Target.Offset(, 1).Resize(, 5).ClearContents
- End If
- End With
- End If
- End If
- End Sub
复制代码 |
|