Preskoči na glavno vsebino

Kako odstraniti prazne vrstice in stolpce iz tabel v Wordu?

Kako lahko odstranite vse prazne vrstice in stolpce iz tabel v Wordu? Ta vadnica vam bo pokazala več načinov odstranjevanja praznih vrstic in stolpcev iz tabel v dokumentu Word.

Iz tabel ročno odstranite vse prazne vrstice in stolpce

Odstranite vse prazne vrstice in stolpce iz tabel s kodo VBA

Odstranite vse prazne vrstice in stolpce iz tabel z enim klikomdobra ideja3


Iz tabel ročno odstranite vse prazne vrstice in stolpce

Microsoft Office Word ne ponuja priročnega načina odstranjevanja praznih vrstic in stolpcev, zato jih morate odstraniti tako, da ročno izberete vsako prazno vrstico in stolpec in jih nato izbrišete enega za drugim.

1. korak: Izberite prazno vrstico ali prazen stolpec, ki ga želite izbrisati. Oglejte si posnetek zaslona:

doc-removerowsandcols-1

3. korak: pod Tabela Orodja, kliknite postavitev Zavihek;

doc-removerowsandcols-2

4. korak: v Vrstice in stolpci skupino, kliknite Izbriši vrstice ali Izbriši stolpce.

doc-removerowsandcols-3


Odstranite vse prazne vrstice in stolpce iz tabel s kodo VBA

Makro funkcija Word ponuja veliko bolj priročen način odstranjevanja vseh praznih vrstic in stolpcev iz tabel v dokumentu. Vse prazne vrstice in stolpce lahko odstranite na naslednji način.

Korak 1: Pritisnite "Alt-F11" odpreti okno Microsoft Visual Basic for Application;

Korak 2: kliknite Moduli o Vstavi zavihek, kopirajte in prilepite naslednjo kodo VBA v okno modula;

3. korak: Nato kliknite Rundoc-revers-sign-6 gumb za uporabo VBA.

Koda VBA za odstranitev vseh praznih vrstic in stolpcev iz tabel:

Sub DeleteEmptyTablerowsandcolumns ()
Application.ScreenUpdating = Napačno
Dim Tbl Kot tabela, cel kot celica, i As Long, n As Long, fEmpty kot Boolean
Z ActiveDocument
Za vsako Tbl v. Tabelah
n = Tbl. Stolpci. Štetje
Za i = n do 1 korak -1
fEmpty = Res
Za vsako celico v stolpcih Tbl. Stolpci (i). Celice
Če je Len (cel.Range.Text)> 2 Potem
fEmpty = False
Izhod za
Konec Če
Naslednja cel
Če je fEmpty = True, potem Tbl.Columns (i) .Delete
Naslednja i
Naslednja Tbl
Končaj s
Z ActiveDocument
Za vsako Tbl v. Tabelah
n = Tbl.Rows.Count
Za i = n do 1 korak -1
fEmpty = Res
Za vsako celico v Tbl.Rows (i) .Cells
Če je Len (cel.Range.Text)> 2 Potem
fEmpty = False
Izhod za
Konec Če
Naslednja cel
Če je fEmpty = True, potem Tbl.Rows (i) .Delete
Naslednja i
Naslednja Tbl
Končaj s
Nastavi cel = Nič: Nastavi Tbl = Nič
Application.ScreenUpdating = Res
End Sub


Odstranite vse prazne vrstice in stolpce iz tabel z enim klikom

Kutools za Word vam ponuja najprimernejši način za odstranjevanje vseh praznih vrstic in stolpcev iz tabel v dokumentu. Samo enkrat kliknite in Kutools za Wordje Delete Rows/Columns pripomoček vam bo hitro odstranil vse prazne vrstice in stolpce iz vseh tabel ali tabel selecetd.

Kutools za Word, z več kot  priročne funkcije, vam olajša delo. 

Po namestitvi Kutools za Word, naredite spodaj:(Brezplačno prenesite Kutools za Word zdaj!)

1. klik Kutools Plus > Delete Rows/Columns o Table okno.

doc odstrani stolpce praznih vrstic iz tabele 1

2. Potem se odpre pogovorno okno, v razdelku Poglej v izberite obseg, iz katerega želite odstraniti tabele, in nato preverite Vrstica možnost in Prazna vrstica ali potrdite Stolpec možnost in Prazna vrstica možnost, kot jo potrebujete. Če želite izbrisati vse prazne vrstice in stolpce, morate to operacijo uporabiti dvakrat.

doc kutools odstrani prazne vrstice 2  doc kutools odstrani prazne vrstice 3 

Zdaj se odpre pogovorno okno, ki vas opozori, s koliko tabelami je bilo opravljenih, kliknite OK zapreti, prazne vrstice in stolpci pa so bili odstranjeni iz tabel.
doc kutools odstrani prazne vrstice 4

Nasvet.Če želite z Excelovega lista odstraniti prazne vrstice, se Izbriši prazne vrstice pripomoček Kutools za Excel vam lahko pomaga.

Najboljša pisarniška orodja za produktivnost

Kutools za Word - Izboljšajte svojo besedno izkušnjo z Over 100 Izjemne lastnosti!

🤖 Kutools AI pomočnik: Preoblikujte svoje pisanje z AI - Ustvarite vsebino  /  Prepiši besedilo  /  Povzemite dokumente  /  Povprašajte za informacije na podlagi dokumenta, vse v Wordu

📘 Obvladovanje dokumentov: Razdeljene strani  /  Spoji dokumente  /  Izvozi izbor v različnih formatih (PDF/TXT/DOC/HTML ...)  /  Paketna pretvorba v PDF  /  Izvozi strani kot slike  /  Natisnite več datotek hkrati...

Urejanje vsebine: Serijsko iskanje in zamenjava čez več datotek  /  Spremeni velikost vseh slik  /  Prenos vrstic in stolpcev tabele  /  Pretvori tabelo v besedilo...

🧹 Čiščenje brez napora: Pometite stran Dodatni prostori  /  Prelomi oddelkov  /  Vse glave  /  Besedilna polja  /  Hiperpovezave  / Za več orodij za odstranjevanje pojdite na naš Odstrani skupino...

Ustvarjalni vložki: Vstavi Tisoč ločila  /  Potrditvena polja  /  Radijske tipke  /  QR koda  /  Črtna koda  /  Tabela z diagonalno črto  /  Naslov enačbe  /  Opis slike  /  Naslov tabele  /  Več slik  / Odkrijte več v Vstavi skupino...

???? Natančne izbire: Natančna točka določene strani  /  mize  /  Oblike  /  odstavki naslova  / Izboljšajte navigacijo z več Izberite funkcije...

Izboljšave zvezdic: Hitra navigacija do katere koli lokacije  /  samodejno vstavljanje ponavljajočega se besedila  /  brez težav preklapljate med okni dokumentov  /  11 Orodja za pretvorbo...

???? Želite preizkusiti te funkcije? Kutools for Word ponuja a 60-dan brezplačni preskus, brez omejitev! 🚀
 
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