回答編集履歴

2

実行後の画像追加

2022/01/25 12:13

投稿

hatena19
hatena19

スコア33740

test CHANGED
@@ -13,3 +13,5 @@
13
13
  End Sub
14
14
  ```
15
15
 
16
+ 実行後のシート
17
+ ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2022-01-25/a05b08f2-43d9-4df3-9233-5b8b83c94a51.png)

1

修正

2022/01/25 09:36

投稿

hatena19
hatena19

スコア33740

test CHANGED
@@ -2,7 +2,7 @@
2
2
  累計は変数に加算していけばいいでしょう。
3
3
 
4
4
  ```vba
5
- Private Sub CommandButton1_Click()
5
+ Private Sub Sample()
6
6
  Dim i As Long, lastrow As Long, total As Long
7
7
  lastrow = Cells(Rows.Count, 1).End(xlUp).Row
8
8
  For i = 2 To lastrow