|
楼主 |
发表于 2018-8-5 23:13
|
显示全部楼层
- 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 8)
- 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
- 'Br(K, 1) = "备注"
- If K > 0 Then
- With Sheets("" & Day(Ar(1, I)) & "")
- .Range("l8:p1000").clear
- .Range("l8").Resize(K, 8) = Br
- 'With .Range("b5:i" & (K + 17))
- ' .BorderAround xlContinuous, xlMedium
- '.Borders.LineStyle = xlContinuous
- '.Borders.ColorIndex = xlAutomatic
- ' End With
- 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 8)
- 'Sheets (Day(Ar(1, I)))
- K = 0
- Next
- End Sub
复制代码
已修改成功,但还是想问下这句后面的1 to 8是什么意思,好像这个在这里不起作用,我删除了又会出错。 |
|