|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
试试看
- Sub test()
- Dim arr, brr(), i&, n&, m&, t$
- arr = Sheet1.Range("A1", Sheet1.Range("E" & Rows.Count).End(xlUp))
- ReDim brr(1 To UBound(arr), 1 To 5)
- For i = 1 To UBound(arr)
- If arr(i, 1) Like "项目编码*" Then
- n = i
- t = Split(arr(i, 3), " ")(UBound(Split(arr(i, 3), " ")))
- ElseIf arr(i, 3) Like "*酸洗*" Then
- m = m + 1
- brr(m, 1) = t
- brr(m, 2) = arr(n, 2)
- brr(m, 3) = arr(i, 3)
- brr(m, 4) = arr(i, 2)
- brr(m, 5) = arr(i, 5)
- End If
- Next
- Application.ScreenUpdating = False
- Sheet1.Range("G2", Sheet1.Range("k" & Rows.Count)).ClearContents
- Sheet1.Range("G2").Resize(m, UBound(brr, 2)) = brr
- Application.ScreenUpdating = True
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|