|
|
- Sub ykcbf() '//2025.12.8
- ApplicationSettings False
- arr = Sheets("删除商家").UsedRange.Value
- For Each k In arr
- ptt = ptt & "|" & k
- Next
- ptt = Mid(ptt, 2)
- Set ws = ActiveSheet
- arr = ws.UsedRange.Value
- u = UBound(arr, 2)
- ReDim brr(1 To UBound(arr), 1 To UBound(arr, 2))
- Dim tm: tm = Timer
- For i = 2 To UBound(arr)
- If styes(arr(i, 1), ptt) = True Then GoTo 100
- m = m + 1
- For j = 1 To u
- brr(m, j) = arr(i, j)
- Next
- 100:
- Next
- ws.[a2].Resize(m, u) = brr
- ws.UsedRange.Offset(m + 1).Clear
- ApplicationSettings True
- MsgBox "共用时:" & Format(Timer - tm, "0.000") & " 秒"
- End Sub
- Function styes(st, ptt) As Boolean
- Dim arr() As String, i As Long
- If ptt = "" Or Trim(st & "") = "" Then Exit Function
- arr = Split(ptt, "|")
- For i = LBound(arr) To UBound(arr)
- If InStr(1, st, arr(i), vbTextCompare) > 0 Then
- styes = True
- Exit Function
- End If
- Next
- End Function
- Private Sub ApplicationSettings(ByVal Reset As Boolean) '//纯office环境
- With Application
- .ScreenUpdating = Reset: .DisplayAlerts = Reset
- .Calculation = IIf(Reset, xlCalculationAutomatic, xlCalculationManual)
- .AskToUpdateLinks = Reset: .EnableEvents = Reset: .EnableAnimations = Reset
- End With
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|