質問編集履歴
2
コード追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -21,3 +21,49 @@
|
|
21
21
|
|
22
22
|
|
23
23
|
アドバイス等ありましたら教示いただけると幸いです。
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
使用のマクロです______________
|
28
|
+
|
29
|
+
Sub Test()
|
30
|
+
|
31
|
+
Dim i As Long, ad As Integer, r As Long
|
32
|
+
|
33
|
+
Dim ws As Worksheet
|
34
|
+
|
35
|
+
Dim wsname As String
|
36
|
+
|
37
|
+
wsname = "食"
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
Sheets(1).Cells.Clear
|
42
|
+
|
43
|
+
For Each ws In Worksheets
|
44
|
+
|
45
|
+
If ws.Name Like "*" & wsname Then
|
46
|
+
|
47
|
+
For i = 2 To ActiveWorkbook.Sheets.Count
|
48
|
+
|
49
|
+
Sheets(i).UsedRange.Copy
|
50
|
+
|
51
|
+
r = Sheets(1).UsedRange.Rows.Count
|
52
|
+
|
53
|
+
If i = 2 Then ad = 0 Else ad = 2 '※
|
54
|
+
|
55
|
+
Cells(r, 1).Offset(ad).Select '※
|
56
|
+
|
57
|
+
ActiveSheet.Paste
|
58
|
+
|
59
|
+
End If
|
60
|
+
|
61
|
+
Next
|
62
|
+
|
63
|
+
Next
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
Sheets(1).Columns.AutoFit
|
68
|
+
|
69
|
+
End Sub
|
1
タイトル
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
[Excel][VBA]
|
1
|
+
[Excel][VBA] 指定の文字列を含むシートのみコピーして1シートにまとめる方法
|
test
CHANGED
File without changes
|