質問編集履歴

2

修正

2020/11/10 06:13

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -36,21 +36,21 @@
36
36
 
37
37
  Dim worksheet As Worksheets
38
38
 
39
-
39
+ For x = 0 To 8
40
40
 
41
- For i = 5 To 14
41
+ For i = 5 To 14
42
42
 
43
- If Worksheets("勤怠確認加減算シート").Cells(i, 9).Value = True Then
43
+ If Worksheets("勤怠確認加減算シート").Cells(i, 9).Value = True Then
44
44
 
45
-   chkName(8) = Worksheets("勤怠確認加減算シート").Cells(i, 10).Value
45
+ chkName(x) = Worksheets("勤怠確認加減算シート").Cells(i, 10).Value
46
46
 
47
-    Range(i, 7) = chkName(8)
47
+ Range(i, 7) = chkName(x)
48
48
 
49
- End If
49
+ End If
50
50
 
51
- Next
51
+ Next
52
52
 
53
-
53
+ Next
54
54
 
55
55
  ```
56
56
 

1

修正

2020/11/10 06:12

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -32,23 +32,25 @@
32
32
 
33
33
  ```VBA
34
34
 
35
- Dim chkName(8) As String, i As Long, x As Long '格納
35
+ Dim chkName(8) As String, i As Long, x As Long
36
36
 
37
- For x = 0 To 8
37
+ Dim worksheet As Worksheets
38
+
39
+
38
40
 
39
41
  For i = 5 To 14
40
42
 
41
- If Cells(i, 9).Value = "True" Then
43
+ If Worksheets("勤怠確認加減算シート").Cells(i, 9).Value = True Then
42
44
 
43
- chkName(x) = Cells(i, 10).value
45
+   chkName(8) = Worksheets("勤怠確認加減算シート").Cells(i, 10).Value
44
46
 
45
- Range(i, 7) = chkName(x)
47
+    Range(i, 7) = chkName(8)
46
48
 
47
49
  End If
48
50
 
49
- Next
51
+ Next
50
52
 
51
- Next
53
+
52
54
 
53
55
  ```
54
56