|
- Sub 多条件工作表查询()
- StartTime = Timer
- Application.ScreenUpdating = False
- Dim str$, str1$
- Dim ran As Range
- With ThisWorkbook.Sheets("查询")
- Set ran = .Range("A5:j25000")
- ran = ""
- brr = .Range("A5:j25000")
- crr = .Range("A2:j2")
- End With
- Arr = Sheets(1).[a1].CurrentRegion
- For j = 2 To UBound(Arr)
- For i = 1 To UBound(crr, 2)
- If crr(1, i) <> "" Then
- str = str & "*" & UCase(crr(1, i)) & "*"
- str1 = str1 & Arr(j, i)
- End If
- Next i
- If str1 Like str And str <> "" Then
- mm = mm + 1
- For m = 1 To UBound(Arr, 2)
- brr(mm, m) = Arr(j, m)
- Next m
- End If
- str1 = ""
- str = ""
- Next j
- ThisWorkbook.Sheets("查询").Columns("b:z").NumberFormat = "@"
- ran = "": ran = brr
- TimeOne = Format(Timer - StartTime, "0.00000") & "秒"
- Application.ScreenUpdating = True
- MsgBox "查询时间:" & TimeOne
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|