|
能否实现在原来将应收账数据写入各表的时候,顺便将带所有单元格中有批注的内容一起写入各表对应金额后面的备注一列中
Sub 应收账()
Dim Sht As Worksheet, I&, J&, Dic, Ar, Br, k&, S!
Set Dic = CreateObject("scripting.dictionary")
Ar = Sheets("应收账").Range("a1").CurrentRegion '30天的月份应清除32列数据
ReDim Br(1 To UBound(Ar) - 1 + 3, 1 To 9)
For I = 2 To UBound(Ar, 2)
For J = 2 To UBound(Ar)
If Ar(J, I) <> "" Then
k = k + 1
Br(k, 3) = Ar(J, I): Br(k, 2) = Ar(J, 1)
S = Ar(J, I) + S
End If
Next
Br(k + 1, 2) = "挂帐合计:": Br(k + 1, 3) = S
k = k + 3
S = 0
If k > 0 Then
With Sheets("" & Day(Ar(1, I)) & "")
.Range("l8:p1000").clear
.Range("l8").Resize(k, 9) = Br
End With
Else
With Sheets("" & Day(Ar(1, I)) & "")
.Range("l8:p1000").clear
End With
End If
ReDim Br(1 To UBound(Ar) - 1 + 3, 1 To 9)
k = 0
Next
End Sub
test.rar
(55.64 KB, 下载次数: 5)
|
|