|
- Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) '双击操作
- Dim Myr As Long
- Dim arr1, arr2
- Application.ScreenUpdating = False
- If Target.Column = 2 Then '限第2列
- Cancel = True
- Myr = Range("a65536").End(xlUp).Row
- arr1 = Range("a2:b" & Myr).Value '
- ReDim arr2(1 To UBound(arr1), 1 To 2)
- For x = 1 To UBound(arr1)
- If Target.Value = arr1(x, 2) And Target.Offset(0, -1) = arr1(x, 1) Then '怎么改都不对
- 'If InStr(Target.Value, arr1(x - 1, 2)) > 0 Then
- r = r + 1
- For j = 1 To 2
- arr2(r, j) = arr1(x, j)
- Next
- End If
- Next
- End If
- [e2:f65536] = ""
- [e2].Resize(UBound(arr2, 1), UBound(arr2, 2)) = arr2
- Application.ScreenUpdating = True
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|