|
- Sub 查找1()
- Dim FindSt$, Rg1 As Range, Rg2 As Range, Arr
- Dim RgA$, RgCol As String, x%, t
- FindSt = "*昆山*"
- Application.ScreenUpdating = False
- t = Timer
- Arr = [a1].CurrentRegion
- Set Rg1 = Range("a1").Resize(UBound(Arr), UBound(Arr, 2))
- For Each b In Rg1
- If b Like FindSt Then
- x = x + 1
- RgCol = RgCol & "," & b.Address(0, 0)
- If x Mod 42 = 0 Then
- If x = 42 Then
- Set Rg2 = Range(Mid(RgCol, 2))
- Else
- Set Rg2 = Union(Rg2, Range(Mid(RgCol, 2)))
- End If
- RgCol = ""
- End If
- End If
- Next
- Rg2.Select
- MsgBox "查询到包含字符:" & FindSt & " 共计:" & x & _
- "条记录!" & vbCrLf & "用时:" & Timer - t & " 秒!" & _
- vbCrLf & vbCrLf & "---Find 查询!"
- Application.ScreenUpdating = True
- End Sub
复制代码 |
评分
-
2
查看全部评分
-
|