Loncat ke daftar isi utama

Bagaimana cara menghapus baris dan kolom kosong dari tabel di Word?

Bagaimana Anda bisa menghapus semua baris dan kolom kosong dari tabel di Word? Tutorial ini akan menunjukkan beberapa cara untuk menghapus baris dan kolom kosong dari tabel di dokumen Word.

Hapus secara manual semua baris dan kolom kosong dari tabel

Hapus semua baris dan kolom kosong dari tabel dengan menggunakan kode VBA

Hapus semua baris dan kolom kosong dari tabel dengan satu klikide bagus3


Hapus secara manual semua baris dan kolom kosong dari tabel

Microsoft Office Word tidak menyediakan cara yang nyaman untuk menghapus baris dan kolom kosong, dan Anda perlu menghapusnya dengan secara manual memilih setiap baris dan kolom kosong, lalu menghapusnya satu per satu.

Langkah 1: Pilih baris atau kolom kosong yang ingin Anda hapus. Lihat tangkapan layar:

doc-removerrowsandcols-1

Langkah 3: Di bawah tabel Alat, klik tata ruang tab;

doc-removerrowsandcols-2

Langkah 4: Di Baris & Kolom kelompok, klik Hapus Baris atau Hapus Kolom.

doc-removerrowsandcols-3


Hapus semua baris dan kolom kosong dari tabel dengan menggunakan kode VBA

Fungsi Makro Word menyediakan cara yang jauh lebih nyaman untuk menghapus semua baris dan kolom kosong dari tabel dalam dokumen. Anda dapat menghapus semua baris dan kolom kosong sebagai berikut.

Langkah 1: Tekan “Alt-F11” untuk membuka jendela Microsoft Visual Basic for Application;

Langkah 2: Klik Modul pada Menyisipkan tab, salin dan tempel kode VBA berikut ke jendela Modul;

Langkah 3: Lalu klik Rundoc-balik-tanda-6 tombol untuk menerapkan VBA.

Kode VBA untuk menghapus semua baris dan kolom kosong dari tabel:

Sub DeleteEmptyTablerowsandcolumns ()
Application.ScreenUpdating = Salah
Dim Tbl As Tabel, sel As Sel, i As Long, n As Long, fEmpty As Boolean
Dengan ActiveDocument
Untuk Setiap Tbl Masuk. Tabel
n = Tbl.Kolom.Hitungan
Untuk i = n Sampai 1 Langkah -1
fEmpty = Benar
Untuk Setiap cel Di Tbl.Columns (i) .Cells
Jika Len (cel.Range.Text)> 2 Kemudian
fEmpty = Salah
Keluar Untuk
End If
Cel berikutnya
Jika fEmpty = True Then Tbl.Columns (i) .Delete
Selanjutnya saya
Tbl berikutnya
Berakhir dengan
Dengan ActiveDocument
Untuk Setiap Tbl Masuk. Tabel
n = Tbl.Baris.Hitungan
Untuk i = n Sampai 1 Langkah -1
fEmpty = Benar
Untuk Setiap cel Dalam Tbl.Rows (i) .Cells
Jika Len (cel.Range.Text)> 2 Kemudian
fEmpty = Salah
Keluar Untuk
End If
Cel berikutnya
Jika fEmpty = True Then Tbl.Rows (i) .Delete
Selanjutnya saya
Tbl berikutnya
Berakhir dengan
Setel cel = Tidak Ada: Set Tbl = Tidak Ada
Application.ScreenUpdating = Benar
End Sub


Hapus semua baris dan kolom kosong dari tabel dengan satu klik

Kutools for Word memberi Anda cara paling nyaman untuk menghapus semua baris dan kolom kosong dari tabel dalam dokumen. Anda hanya perlu mengklik sekali, dan Kutools for Word's Delete Rows/Columns utilitas akan menghapus semua baris dan kolom kosong dari semua atau tabel selecetd untuk Anda dengan cepat.

Kutools for Word, dengan lebih dari  fungsi praktis, membuat pekerjaan Anda lebih mudah. 

Setelah menginstal Kutools for Word, lakukan seperti di bawah ini:(Unduh Gratis Kutools untuk Word Sekarang!)

1. klik Kutools Ditambah > Delete Rows/Columns pada Table pane

doc menghapus kolom baris kosong dari tabel 1

2. Kemudian sebuah dialog muncul, pilih ruang lingkup yang ingin Anda hapus tabelnya di bagian Lihat di, lalu centang Baris pilihan dan Baris kosong opsi, atau centang Kolom pilihan dan Baris kosong pilihan yang Anda butuhkan. Jika Anda ingin menghapus semua baris dan kolom kosong, Anda perlu menerapkan operasi ini dua kali.

doc kutools menghapus baris kosong 2  doc kutools menghapus baris kosong 3 

Sekarang sebuah dialog muncul untuk mengingatkan Anda berapa banyak tabel yang telah ditangani, klik OK untuk menutup, dan baris dan kolom kosong telah dihapus dari tabel.
doc kutools menghapus baris kosong 4

Ketik.Jika Anda ingin menghapus baris kosong dari lembar Excel, file Hapus Baris Kosong kegunaan Kutools for Excel dapat membantu Anda.

Alat Produktivitas Kantor Terbaik

Kutools for Word - Tingkatkan Pengalaman Kata Anda dengan Over 100 Fitur Luar Biasa!

🤖 Asisten AI Kutools: Ubah tulisan Anda dengan AI - Hasilkan Konten  /  Menulis Ulang Teks  /  Meringkas Dokumen  /  Menanyakan Informasi berdasarkan Dokumen, semuanya dalam Word

📘 Penguasaan Dokumen: Halaman Terpisah  /  Gabungkan Dokumen  /  Ekspor Pilihan dalam Berbagai Format (PDF/TXT/DOC/HTML...)  /  Konversi Batch ke PDF  /  Ekspor Halaman sebagai Gambar  /  Cetak Banyak File sekaligus...

Pengeditan Isi: Temukan dan Ganti Batch di Banyak File  /  Ubah Ukuran Semua Gambar  /  Ubah Urutan Baris dan Kolom Tabel  /  Ubah Tabel menjadi Teks...

🧹 Bersih dengan Mudah: Menyapu Spasi Ekstra  /  Bagian Istirahat  /  Semua Header  /  Teks box  /  Hyperlink  / Untuk alat penghapus lainnya, kunjungi kami Hapus Grup...

Sisipan Kreatif: Memasukkan Seribu Pemisah  /  Kotak Centang  /  Tombol Radio  /  Kode QR  /  barcode  /  Tabel Garis Diagonal  /  Keterangan Persamaan  /  Keterangan gambar  /  Keterangan Tabel  /  Banyak Gambar  / Temukan lebih lanjut di Sisipkan Grup...

🔍 Pilihan Presisi: Tepat halaman tertentu  /  tabel  /  bentuk  /  paragraf judul  / Tingkatkan navigasi dengan lebih Pilih fitur...

Peningkatan Bintang: Navigasi dengan cepat ke lokasi mana pun  /  menyisipkan teks berulang secara otomatis  /  beralih antar jendela dokumen dengan mulus  /  11 Alat Konversi...

👉 Ingin mencoba fitur-fitur tersebut? Kutools for Word menawarkan a Uji coba gratis 60-hari, tanpa batasan! 🚀
 
Comments (16)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi
Many many thanks. Its 100% worked.
This comment was minimized by the moderator on the site
Hi, thanks for the CODE, it worked on a document with only one table.

but when launching it on a word document with different tables from different sizes, i got this error : "Run-time error '5992' Cannot access individual columns in this collection because the table has mixed cell widths"

Can anybody help, please
This comment was minimized by the moderator on the site
Bonjour,

Quand j'exécute le programme, l'erreur suivante s'affiche " Erreur de compilation : Instruction incorrecte à l'extérieur d'une procédure"

Quelqu'un a une solution s'il vous plait ?
This comment was minimized by the moderator on the site
I found this macro and it works great when it comes to a table with single empty rows.
Is it possible to change it to work on a table with split rows as well?
I would very much thank you if you have a solution for me.
This comment was minimized by the moderator on the site
Hi, shimon, I don't not understand your question, please give me examples or describe the question with more details.
This comment was minimized by the moderator on the site
You just saved me a zillion hours of frustration, THANK YOU!
This comment was minimized by the moderator on the site
u know you can just resize the table right? just filter and sort your data to top check how many rows have data, click table tools and the click resize and adjust the last number to whatever you need OR go to the bottom of the table the very last cell and use the tine blue triangle to drag and resize,
This comment was minimized by the moderator on the site
Except I have multiple page document with a table with varying information in each. Furthermore, it is a merge document so different each week. I need an automated method :)
This comment was minimized by the moderator on the site
Hi, the macro is working, BUT:

After deleting all rows, all the columns of the tables with empty rows open up very wide.

How can i fix the code so that this does not happens?


I am using Office 2016.


Thank you!
This comment was minimized by the moderator on the site
Hi All, I am looking for function in word wherein, if I remove specific word then it should remove that row as well.
This comment was minimized by the moderator on the site
Thanks for the code, really useful.
This comment was minimized by the moderator on the site
Is there a macro that will delete a row if only one of the cells in that row is empty or contains a zero?
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations