|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
常规来说,不是先开收据收款,然后才记账吗?
Sub TEST()
ARR = Sheets("日记账").UsedRange
Set Rng = Sheets("模板").Rows("1:7")
For I = 2 To UBound(ARR)
If ARR(I, 3) = "收款" Then
N = N + 1
With Sheets("收款收据")
Rng.Copy .Cells(N * 8 - 7, 1)
.Cells(N * 8 - 6, 2) = ARR(I, 1)
.Cells(N * 8 - 6, 4) = ARR(I, 2)
.Cells(N * 8 - 5, 2) = ARR(I, 6)
.Cells(N * 8 - 5, 4) = ARR(I, 5)
.Cells(N * 8 - 4, 2) = Replace(Replace(Replace(Join(Application.Text(Split(Format(ARR(I, 7), " 0. 0 0;负 0. 0 0; ")), ["[DBnum2]"&{0, "","元0角;;元零","0分;;整"}]), a), "零元零", a), "零元", a), "零整", "整")
' 网上找来的一句大写代码
.Cells(N * 8 - 4, 4) = ARR(I, 7)
.Cells(N * 8 - 3, 2) = ARR(I, 4)
End With
End If
Next
End Sub
|
|