Loncat ke daftar isi utama

Bagaimana cara menghapus cache filter (item lama) dari Pivot Table di Excel?

Penulis: Siluvia Terakhir Dimodifikasi: 2020-05-28

Seperti gambar di bawah ini yang ditunjukkan, Anda membuat Tabel Pivot berdasarkan berbagai data. Setelah menghapus data dari rentang sumber, item lama akan tetap ada di menu drop-down Tabel Pivot meskipun Anda menyegarkan Tabel Pivot. Jika Anda ingin menghapus semua item lama dari menu drop-down Tabel Pivot, metode dalam artikel ini dapat membantu Anda.

Hapus cache filter (item lama) dari Tabel Pivot dengan mengubah opsinya
Hapus cache filter (item lama) dari semua Tabel Pivot dengan menggunakan kode VBA


Hapus cache filter (item lama) dari Tabel Pivot dengan mengubah opsinya

Anda dapat menghapus cache filter dari Tabel Pivot dengan mengubah opsinya. Silakan lakukan sebagai berikut.

1. Klik kanan pada sel mana pun di dalam Tabel Pivot, lalu klik Opsi PivotTable dari menu konteks. Lihat tangkapan layar:

2. Dalam Opsi PivotTable kotak dialog, klik Data tab, pilih None dari Jumlah item untuk dipertahankan per bidang daftar drop-down, dan kemudian klik OK .

3. Klik kanan pada sel Tabel Pivot, lalu klik menyegarkan dari menu klik kanan. Lihat tangkapan layar:

Kemudian Anda dapat melihat item lama dihapus dari menu drop-down Tabel Pivot seperti gambar di bawah ini.


Hapus cache filter (item lama) dari semua Tabel Pivot dengan menggunakan kode VBA

Jika Anda ingin menghapus cache filter dari semua Tabel Pivot di beberapa lembar kerja di buku kerja aktif. Silakan coba skrip VBA di bawah ini.

1. Di buku kerja Anda perlu menghapus item lama dari semua Tabel Pivot, tekan lain + F11 tombol secara bersamaan untuk membuka Jendela Microsoft Visual Basic for Applications.

2. Dalam Microsoft Visual Basic untuk Aplikasi jendela, klik dua kali Buku Kerja Ini dalam Project panel untuk membuka ThisWorkbook (Kode) jendela, lalu salin dan tempel kode VBA di bawah ini ke dalam jendela.

Kode VBA: Hapus cache filter (item lama) dari semua Tabel Pivot di buku kerja aktif

Private Sub Workbook_Open()
    Dim xPt As PivotTable
    Dim xWs As Worksheet
    Dim xPc As PivotCache
    Application.ScreenUpdating = False
    For Each xWs In ActiveWorkbook.Worksheets
        For Each xPt In xWs.PivotTables
            xPt.PivotCache.MissingItemsLimit = xlMissingItemsNone
        Next xPt
    Next xWs
    For Each xPc In ActiveWorkbook.PivotCaches
        On Error Resume Next
        xPc.Refresh
    Next xPc
    Application.ScreenUpdating = True
End Sub

3. tekan F5 kunci untuk menjalankan kode, lalu item lama segera dihapus dari menu drop-down semua Tabel Pivot di buku kerja aktif.


Terkait artikel:

Alat Produktivitas Kantor Terbaik

馃 Kutools AI Ajudan: Merevolusi analisis data berdasarkan: Eksekusi Cerdas   |  Hasilkan Kode  |  Buat Rumus Khusus  |  Analisis Data dan Hasilkan Grafik  |  Aktifkan Fungsi Kutools...
Fitur Populer: Temukan, Sorot, atau Identifikasi Duplikat   |  Hapus Baris Kosong   |  Gabungkan Kolom atau Sel tanpa Kehilangan Data   |   Putaran tanpa Formula ...
Pencarian Super: VLookup Beberapa Kriteria    VLookup Nilai Berganda  |   VLookup di Beberapa Lembar   |   Pencarian Fuzzy ....
Daftar Drop-down Lanjutan: Buat Daftar Drop Down dengan Cepat   |  Daftar Drop Down yang Bergantung   |  Multi-pilih Drop Down List ....
Manajer Kolom: Tambahkan Jumlah Kolom Tertentu  |  Pindahkan Kolom  |  Alihkan Status Visibilitas Kolom Tersembunyi  |  Bandingkan Rentang & Kolom ...
Fitur Unggulan: Fokus Kisi   |  Tampilan Desain   |   Bar Formula Besar    Manajer Buku Kerja & Lembar   |  Perpustakaan Sumberdaya (Teks otomatis)   |  Pemetik tanggal   |  Gabungkan Lembar Kerja   |  Enkripsi/Dekripsi Sel    Kirim Email berdasarkan Daftar   |  Filter Super   |   Filter Khusus (filter tebal/miring/coret...) ...
15 Perangkat Teratas12 Teks Tools (Tambahkan Teks, Hapus Karakter, ...)   |   50 + Grafik jenis (Gantt Chart, ...)   |   40+ Praktis Rumus (Hitung usia berdasarkan ulang tahun, ...)   |   19 Insersi Tools (Masukkan Kode QR, Sisipkan Gambar dari Jalur, ...)   |   12 Konversi Tools (Angka ke Kata, Konversi Mata Uang, ...)   |   7 Gabungkan & Pisahkan Tools (Lanjutan Gabungkan Baris, Pisahkan Sel, ...)   |   ... dan banyak lagi

Tingkatkan Keterampilan Excel Anda dengan Kutools for Excel, dan Rasakan Efisiensi yang Belum Pernah Ada Sebelumnya. Kutools for Excel Menawarkan Lebih dari 300 Fitur Lanjutan untuk Meningkatkan Produktivitas dan Menghemat Waktu.  Klik Di Sini untuk Mendapatkan Fitur yang Paling Anda Butuhkan...

Deskripsi Produk


Tab Office Membawa antarmuka Tab ke Office, dan Membuat Pekerjaan Anda Jauh Lebih Mudah

  • Aktifkan pengeditan dan pembacaan tab di Word, Excel, PowerPoint, Publisher, Access, Visio, dan Project.
  • Buka dan buat banyak dokumen di tab baru di jendela yang sama, bukan di jendela baru.
  • Meningkatkan produktivitas Anda sebesar 50%, dan mengurangi ratusan klik mouse untuk Anda setiap hari!
Comments (14)
Rated 5 out of 5 1 ratings
This comment was minimized by the moderator on the site
Hola. Muchisimas gracias, tu ejemplo practico me ayudo mucho y logre resolver el incovenienre.
Me fui por la primera opci贸n, desde la tabla dinamica.
Rated 5 out of 5
This comment was minimized by the moderator on the site
I am facing similar cache issue in my pivot tables and charts created using Power Pivot. Will the above two options works for Pivot Tables created using Power Pivot? Please let me know, if you have any other solution for Power Pivots.
This comment was minimized by the moderator on the site
Hi Manikanta,
The methods provided in this post haven't tested in Power Pivots, sorry I can't help you.
This comment was minimized by the moderator on the site
Thank you Crystal, for the reply. Can anyone suggest other forums to get the solution to remove filter catch for Power Pivot.
This comment was minimized by the moderator on the site
Hi Manikanta,
Maybe you can post your question in our forum. You may get help from others there.
https://www.extendoffice.com/forum/categories/3-excel.html
This comment was minimized by the moderator on the site
You are Awesome!!
Thank you.
This comment was minimized by the moderator on the site
Merci beaucoup ! Depuis le temps que je cherchais 脿 effacer ces caches.... ce n'茅tait pas 茅vident 脿 trouver, voire impossible sans votre aide !
This comment was minimized by the moderator on the site
Thank you!!
This comment was minimized by the moderator on the site
Sir, Thank you very much. it works wonderfully. I was annoyed by this problem. Thanx a lot.
This comment was minimized by the moderator on the site
run time error '1004'... it does not work for me..why?
This comment was minimized by the moderator on the site
Hi mark,
Which Excel version are you using?
This comment was minimized by the moderator on the site
it works, thank you
This comment was minimized by the moderator on the site
It worked for me. Thank you!
This comment was minimized by the moderator on the site
I got a pivot of a table where the filter shows an incorrect value. The analyst name is A in the filter (set retain values to none) but if you go to the table, the same line has the analyst B. If you double click on the line in the pivot table it generates a sheet with the data where the analyst name is B despite the pivot showing A. This table is updated once a month, it worries me because I often do this, update my raw data and update the pivot, now that I have this precedent I cannot trust the information is correct.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
Rate this post:
0   Characters
Suggested Locations