|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub mhcx()
- findchar = Sheets("查询").Range("a2")
- arr = Sheet1.Range("A1").CurrentRegion
- r = UBound(arr)
- ReDim brr(1 To r, 1 To 13)
- For i = 2 To r
- If InStr(1, arr(i, 2), findchar) > 0 Or InStr(1, arr(i, 3), findchar) > 0 Then
- p = p + 1
- For j = 1 To 13
- brr(p, j) = IIf(j > 3, arr(i, j + 2), arr(i, j))
- Next
- End If
- Next
- Sheets("查询").UsedRange.Offset(4).Delete
- If p > 0 Then
- With Sheets("查询").[a5].Resize(p, 13)
- .Value = brr
- .Font.Name = "arial"
- .Font.Size = 9
- .Borders.LineStyle = xlContinuous
- .Borders.Weight = xlThin
- .Borders.ColorIndex = 23
- End With
- End If
- End Sub
复制代码 |
|