回答編集履歴

2

誤字修正

2021/07/13 06:40

投稿

neconekocat
neconekocat

スコア443

test CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  ```VBA
14
14
 
15
- Dim i Ar Long
15
+ Dim i As Long
16
16
 
17
17
 
18
18
 

1

他の問題点に対する回答を追記

2021/07/13 06:40

投稿

neconekocat
neconekocat

スコア443

test CHANGED
@@ -1,3 +1,33 @@
1
1
  Set sh2 = Worksheets(" 出欠1")
2
2
 
3
3
  空白が混じってるのが怪しい
4
+
5
+
6
+
7
+ 追記
8
+
9
+ 行毎に処理する必要があるので、ループを使います。
10
+
11
+
12
+
13
+ ```VBA
14
+
15
+ Dim i Ar Long
16
+
17
+
18
+
19
+ For i = 2 To 71
20
+
21
+ If sh2.Cells(i, 2).Value = "出席" Then
22
+
23
+ sh1.Cells(i + 1, 2).Value = "1"
24
+
25
+ Else
26
+
27
+ sh1.Cells(i + 1, 2).Value = "0"
28
+
29
+ End If
30
+
31
+ Next
32
+
33
+ ```