回答編集履歴

1

コード修正

2019/04/09 00:40

投稿

hatena19
hatena19

スコア33699

test CHANGED
@@ -76,23 +76,27 @@
76
76
 
77
77
  Do Until filename <> ""
78
78
 
79
- '③
79
+ With Workbooks.Open(folderPath & "\" & filename).Sheets(1)
80
80
 
81
- For i = 0 To 7
81
+ '③
82
82
 
83
- If Not LogDateExist(i) Then
83
+ For i = 0 To 7
84
84
 
85
- Set findRng = Range("A1:A" & LastRow).Find(LogDate(i), LookAt:=xlPart)
85
+ If Not LogDateExist(i) Then
86
86
 
87
- If Not findRng Is Nothing Then
87
+ Set findRng = .Range("A1:A" & LastRow).Find(LogDate(i), LookAt:=xlPart)
88
88
 
89
+ If Not findRng Is Nothing Then
90
+
89
- LogDateExist(i) = True
91
+ LogDateExist(i) = True
92
+
93
+ End If
90
94
 
91
95
  End If
92
96
 
93
- End If
97
+ Next
94
98
 
95
- Next
99
+ End With
96
100
 
97
101
  filename = Dir()
98
102