Sub test()
Dim s$, r%, i%
Application.ScreenUpdating = False
Sheets("现金日记帐").Select
s = "本月合计,本月累计,累计,本年累计,过次页,承前页"
r = Range("f65536").End(xlUp).Row
For i = 6 To r
If s Like "*" & Cells(i, "f") & "*" Then
Cells(i, "m") = Cells(i - 1, "m")
Else
If Cells(i, "f") <> "" Then
Cells(i, "m") = Cells(i - 1, "m") + Cells(i, "h") - Cells(i, "j") 'M5+H6-J6
Else
Cells(i, "m") = 0
End If
End If
Next i
End Sub
用代码:将现金账余额运行2.rar
(19.87 KB, 下载次数: 11)