Private Sub ExSyukei(lstr As Long, lenr As Long)
Dim i As Long
Dim j As Long
Dim lin(7) As Long
Dim sin(7) As String
Dim lout(14) As Long
Dim sout(14) As String
For i = lstr To lenr
'給与
If Cells(i, 4) = Sheets("日々の収入・支出入力").CommandButton1.Caption And Cells(i, 5) <> "" Then
lin(0) = lin(0) + Cells(i, 5)
'賞与
ElseIf Cells(i, 4) = Sheets("日々の収入・支出入力").CommandButton2.Caption And Cells(i, 5) <> "" Then
lin(1) = lin(1) + Cells(i, 5)
'パート
ElseIf Cells(i, 4) = Sheets("日々の収入・支出入力").CommandButton3.Caption And Cells(i, 5) <> "" Then
lin(2) = lin(2) + Cells(i, 5)
'アルバイト
ElseIf Cells(i, 4) = Sheets("日々の収入・支出入力").CommandButton4.Caption And Cells(i, 5) <> "" Then
lin(3) = lin(3) + Cells(i, 5)
'年金
ElseIf Cells(i, 4) = Sheets("日々の収入・支出入力").CommandButton5.Caption And Cells(i, 5) <> "" Then
lin(4) = lin(4) + Cells(i, 5)
'雑収入
ElseIf Cells(i, 4) = Sheets("日々の収入・支出入力").CommandButton6.Caption And Cells(i, 5) <> "" Then
lin(5) = lin(5) + Cells(i, 5)
'その他
ElseIf Cells(i, 4) = Sheets("日々の収入・支出入力").CommandButton7.Caption And Cells(i, 5) <> "" Then
lin(6) = lin(6) + Cells(i, 5)
'該当なし
ElseIf Cells(i, 4) <> "" And Cells(i, 5) <> "" Then
lin(7) = lin(7) + Cells(i, 5)
End If
Next
MsgBox lin(0) & " " & lin(1) & " " & lin(2) & " " & _
lin(3) & " " & lin(4) & " " & lin(5) & " " & lin(6) & " " & lin(7)
End Sub
'先週ボタン
Private Sub CommandButton2_Click()
Dim stdt As Date
Dim endt As Date
Dim strow As Long
Dim enrow As Long
ExGetAgoWeek stdt, endt
Debug.Print stdt & " ~ " & endt
MyDataSort
'期間内の行の範囲を調べる
MyFindDate stdt, endt, strow, enrow
ExSyukei strow, enrow
End Sub
■■■
このサイトの内容を利用して発生した、いかなる問題にも一切責任は負いませんのでご了承下さい
■■■
当ホームページに掲載されているあらゆる内容の無許可転載・転用を禁止します