|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub 项目付款明细()
- Dim nRow, arr
- Dim nRow1, arr1, brr, crr
- Dim sh As Worksheet
- Application.ScreenUpdating = False
- With Sheets("台账汇总")
- nRow = .Range("a" & .Rows.Count).End(3).Row
- arr = .Range("a5:f" & nRow)
- End With
-
- With Sheets("项目付款明细")
- nRow1 = .Range("a" & .Rows.Count).End(3).Row
- arr1 = .Range("a6:g" & nRow1)
- brr = .Range("b6:b" & nRow1)
- crr = .Range("h6:h" & nRow1)
- End With
-
- For i = 1 To UBound(arr)
- For j = 1 To UBound(arr1)
- If arr1(j, 1) = arr(i, 1) Then
- For k = 3 To 7
- arr1(j, k) = arr(i, k - 1)
- Next k
- End If
- Next j
- Next i
-
- Sheets("项目付款明细").Range("a6:g" & nRow1) = arr1
-
- For Each sh In Worksheets
- For i = 1 To UBound(brr)
- If sh.Name = brr(i, 1) Then
- crr(i, 1) = sh.Range("C7")
- End If
- Next i
- Next sh
- Sheets("项目付款明细").Range("h6:h" & nRow1) = crr
- Application.ScreenUpdating = True
- End Sub
复制代码 |
评分
-
2
查看全部评分
-
|