|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
我的理解是你要筛选多个单号呢。如果是两种情况都可能的话,修改一下:
- Sub u()
- Dim crr(1 To 2000, 1 To 14)
- arr = Range([a1], Cells(Rows.Count, 14).End(3))
- r = Cells(Rows.Count, "p").End(3).Row
- brr = Range("p1:p" & r)
- For i = 2 To UBound(arr)
- If r < 2 Then
- If InStr(arr(i, 5), [p1]) Then
- m = m + 1
- For j = 1 To 14
- crr(m, j) = arr(i, j)
- Next
- End If
- Else
- For k = 1 To UBound(brr)
- If InStr(arr(i, 5), brr(k, 1)) Then
- m = m + 1
- For j = 1 To 14
- crr(m, j) = arr(i, j)
- Next
- End If
- Next
- End If
- Next
- If m Then
- Sheet2.Cells.ClearContents
- Sheet2.[a2].Resize(m, 14) = crr
- End If
- End Sub
复制代码
|
|