|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
参与一下。。。- Sub ykcbf() '//2024.1.27
- Dim arr, brr(1 To 1000, 1 To 5)
- Set sh = ThisWorkbook.Sheets("列表")
- For Each sht In Sheets(Array("应收账款明细表", "预付账款明细表", "其他应收款明细表", "应付账款明细表", "预收账款明细表", "其他应付款明细表"))
- With sht
- arr = .UsedRange
- For i = 9 To UBound(arr)
- If arr(i, 11) = "已询证" Then
- If arr(i, 16) <> 0 Then
- m = m + 1
- brr(m, 1) = m
- brr(m, 2) = arr(i, 2)
- brr(m, 3) = IIf((InStr(.Name, "应收") Or InStr(.Name, "预付")), arr(i, 16), 0)
- brr(m, 4) = IIf((InStr(.Name, "应付") Or InStr(.Name, "预收")), arr(i, 16), 0)
- brr(m, 5) = Replace(.Name, "明细表", "")
- End If
- End If
- Next
- End With
- Next
- With sh
- .[a3:e1000] = ""
- .[a3].Resize(m, 5) = brr
- .[a3].Resize(m, 5).Borders.LineStyle = 1
- End With
- MsgBox "OK!"
- End Sub
复制代码
|
|