teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

CODE 修正

2018/12/12 09:53

投稿

seastar3
seastar3

スコア2287

answer CHANGED
@@ -21,8 +21,8 @@
21
21
  Cells(指定行, 3) = 記録日
22
22
  Cells(指定行, 4) = 入金金額
23
23
  Cells(指定行, 5) = 出金金額
24
- 入金累計 = WorksheetFunction.Sum(Range(Cells(3, 4), Cells(指定行, 4)))
24
+ 入金累計 = WorksheetFunction.Sum(Range(Cells(開始行番号, 4), Cells(指定行, 4)))
25
- 出金累計 = WorksheetFunction.Sum(Range(Cells(3, 5), Cells(指定行, 5)))
25
+ 出金累計 = WorksheetFunction.Sum(Range(Cells(開始行番号, 5), Cells(指定行, 5)))
26
26
  残高金額 = 入金累計 - 出金累計
27
27
  Cells(指定行, 6) = 残高金額
28
28
  End Sub