|
- Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
- If Target.Count > 1 Then Exit Sub
- If Not Target.Address(False, False) Like "[HKN]*" Then Exit Sub
- If Len(Target) = 0 Then Exit Sub
- If Len(Target.Offset(, 1)) = 0 Then Exit Sub
- Dim lLastRow As Long
- With Sh
- Application.EnableEvents = False
- Application.ScreenUpdating = False
- lLastRow = .Cells(Rows.Count, "b").End(xlUp).Row + 1
- .Cells(lLastRow, 2) = Target
- .Cells(lLastRow, 4) = Target.Offset(, 1)
- Application.EnableEvents = True
- Application.ScreenUpdating = True
- End With
- End Sub
复制代码 代码放在THISWORKBOOK里。
只做了点取HNK三列,相关的数据就会复制过去。
|
评分
-
查看全部评分
|