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

回答編集履歴

1

123

2021/07/13 06:38

投稿

tosi
tosi

スコア553

answer CHANGED
@@ -2,9 +2,9 @@
2
2
  "B2:B71"と指定するならばCellsでは無く、Range("B2:B71")と記述します。
3
3
  "B2:B71"でループする場合には、neconekocat様の様に記述します。
4
4
  ```VBA
5
- If sh2.Cells("2,71") = "出席 " Then
5
+ If sh2.Cells(2,71) = "出席 " Then
6
- sh1.Cells("3,72") = "1"
6
+ sh1.Cells(3,72) = "1"
7
7
  Else
8
- sh1.Cells("3,72") = "2"
8
+ sh1.Cells(3,72) = "2"
9
9
  End If
10
10
  ```