回答編集履歴

1

コメントに基づき、Private Function get_weekの内容を修正しました。

2019/11/12 14:55

投稿

tatsu99
tatsu99

スコア5436

test CHANGED
@@ -26,9 +26,13 @@
26
26
 
27
27
  Dim wrow As Long
28
28
 
29
+ Dim result As Variant
30
+
29
31
  For wrow = 2 To CLng(lastrow)
30
32
 
31
- If InStr(ws.Cells(wrow, "A").Value, key) > 0 Then
33
+ result = Cells(wrow, "A").Value Like key & "*Total"
34
+
35
+ If result = True Then
32
36
 
33
37
  get_week = ws.Cells(wrow, "B").Value
34
38