質問編集履歴
1
作成したコードを添付します。
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,4 +18,50 @@
|
|
18
18
|
|
19
19
|
|
20
20
|
|
21
|
+
Set Sh2 = Sheets(c.Text)でデバッグとなるのですが、何が原因なのでしょうか。
|
22
|
+
|
23
|
+
|
24
|
+
|
21
|
-
アドバイスよろしくお願いいたします
|
25
|
+
アドバイスよろしくお願いいたします```
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
```Sub Test()
|
30
|
+
|
31
|
+
Dim c As Range
|
32
|
+
|
33
|
+
Dim Sh1 As Worksheet, Sh2 As Worksheet
|
34
|
+
|
35
|
+
Dim FRange As Range
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
Set Sh1 = Sheets("?f?[?^")
|
40
|
+
|
41
|
+
For Each c In Sh1.Range(Sh1.Cells(2, "A"), Sh1.Cells(Rows.Count, "A").End(xlUp))
|
42
|
+
|
43
|
+
Set Sh2 = Sheets(c.Text)
|
44
|
+
|
45
|
+
Set FRange = Sh2.Range(Sh2.Cells(6, "C"), Sh2.Cells(Rows.Count, "C").End(xlUp)). _
|
46
|
+
|
47
|
+
Find(What:=c.Offset(0, 2).Value, LookIn:=xlValues, lookat:=xlWhole)
|
48
|
+
|
49
|
+
If FRange Is Nothing Then
|
50
|
+
|
51
|
+
Sheets(c.Text).Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Resize(1, 10).Value = _
|
52
|
+
|
53
|
+
c.Resize(1, 10).Value
|
54
|
+
|
55
|
+
End If
|
56
|
+
|
57
|
+
Set Sh2 = Nothing
|
58
|
+
|
59
|
+
Next
|
60
|
+
|
61
|
+
Set Sh1 = Nothing
|
62
|
+
|
63
|
+
End Sub
|
64
|
+
|
65
|
+
コード
|
66
|
+
|
67
|
+
```
|