質問編集履歴

4

追記した該当のソースコードを訂正しました

2018/12/10 04:51

投稿

floor
floor

スコア12

test CHANGED
File without changes
test CHANGED
@@ -36,7 +36,7 @@
36
36
 
37
37
  ```vba
38
38
 
39
- For Each pvt In Ws2_4.PivotTables
39
+ For Each pvt In Ws.PivotTables
40
40
 
41
41
  pvt.PivotCache.Refresh
42
42
 

3

該当のソースコードを追記

2018/12/10 04:51

投稿

floor
floor

スコア12

test CHANGED
File without changes
test CHANGED
@@ -35,6 +35,14 @@
35
35
 
36
36
 
37
37
  ```vba
38
+
39
+ For Each pvt In Ws2_4.PivotTables
40
+
41
+ pvt.PivotCache.Refresh
42
+
43
+ Next
44
+
45
+
38
46
 
39
47
  Set pf = Ws.PivotTables("ピボットテーブル").PivotFields("番号")
40
48
 

2

補足情報を追記

2018/12/10 04:47

投稿

floor
floor

スコア12

test CHANGED
File without changes
test CHANGED
@@ -136,4 +136,4 @@
136
136
 
137
137
 
138
138
 
139
- EXCEL 2016 使用
139
+ EXCEL 2016 / Windows10 使用

1

マクロの記録の結果を追加

2018/12/06 10:23

投稿

floor
floor

スコア12

test CHANGED
File without changes
test CHANGED
@@ -108,6 +108,30 @@
108
108
 
109
109
 
110
110
 
111
+ ```vba
112
+
113
+ ActiveSheet.PivotTables("ピボットテーブル").PivotFields("番号").CurrentPage = "(All)"
114
+
115
+ With ActiveSheet.PivotTables("ピボットテーブル").PivotFields("番号")
116
+
117
+ .PivotItems("12345").Visible = False
118
+
119
+ .PivotItems("23456").Visible = False
120
+
121
+ .PivotItems("34567").Visible = False
122
+
123
+ '以下省略
124
+
125
+ End With
126
+
127
+ ```
128
+
129
+ また、VBAを使わず手動でフィルターを「5*」で検索した場合のマクロの記録では、
130
+
131
+ 上記の結果となり、「5*」以外の値を明記する必要が生じてしまいます。
132
+
133
+
134
+
111
135
  ### 補足情報(FW/ツールのバージョンなど)
112
136
 
113
137