程序代码:
Sub 出纳日记帐hz()
'汇总A表,用整体复制粘贴法
Sheet3.Select
Cells(4, 4).Value = "年初结余"
For i = 1 To 2 '--如果有5个出纳帐,则将此处的循环结束值修改为5
Sheet3.Cells(4, 7).Value = Sheet3.Cells(4, 7).Value + Sheets("出纳" & i).Cells(4, 7).Value
Next i ' 将每个出纳的“年初结余”合在一起,写入到汇总表的结余栏中
'---
Sheet1.Select
x1 = 5
Do While Not (IsEmpty(Sheet1.Cells(x1, 1).Value))
x1 = x1 + 1
Loop
Range(Cells(5, 1), Cells(x1, 7)).Select
Selection.Copy
Sheet3.Select
Range("A5").Select
ActiveSheet.Paste
Sheet3.Cells(4, 2).Value = ""
Sheet3.Cells(4, 3).Value = ""
'---完成将出纳1的日记帐复制粘贴到汇总表上
Sheet2.Select
x2 = 5
Do While Not (IsEmpty(Sheet2.Cells(x2, 1).Value))
x2 = x2 + 1
Loop
Range(Cells(5, 1), Cells(x2, 7)).Select
Selection.Copy
Sheet3.Select
Range("A" & x1).Select
ActiveSheet.Paste
'---完成将出纳2的日记帐复制粘贴到汇总表上
x3 = 5
Do While Not (IsEmpty(Sheet3.Cells(x3, 1).Value))
N_sr = Sheet3.Cells(x3, 5).Value
N_zc = Sheet3.Cells(x3, 6).Value
Sheet3.Cells(x3, 7).Value = Sheet3.Cells(x3 - 1, 7).Value + N_sr - N_zc
x3 = x3 + 1
Loop '--对每日结余额进行重算
End Sub
图片附件: 游客没有浏览图片的权限,请
登录 或
注册
图片附件: 游客没有浏览图片的权限,请
登录 或
注册
图片附件: 游客没有浏览图片的权限,请
登录 或
注册