Skip i'r prif gynnwys

Sut i dynnu rhesi a cholofnau gwag o dablau yn Word?

Sut allwch chi gael gwared ar yr holl resi a cholofnau gwag o dablau yn Word? Bydd y tiwtorial hwn yn dangos sawl ffordd i chi dynnu rhesi a cholofnau gwag o dablau yn nogfen Word.

Tynnwch yr holl resi a cholofnau gwag â llaw o fyrddau

Tynnwch yr holl resi a cholofnau gwag o dablau trwy ddefnyddio cod VBA

Tynnwch yr holl resi a cholofnau gwag o dablau gydag un clicsyniad da3


Tynnwch yr holl resi a cholofnau gwag â llaw o fyrddau

Nid yw Microsoft Office Word yn darparu ffordd gyfleus i gael gwared ar resi a cholofnau gwag, ac mae angen i chi eu tynnu trwy ddewis pob rhes a cholofn wag â llaw ac yna eu dileu fesul un.

Cam 1: Dewiswch y rhes wag neu'r golofn wag rydych chi am ei dileu. Gweler y screenshot:

doc-tynnusandcols-1

Cam 3: O dan Tabl Offer, cliciwch y Gosodiad Tab;

doc-tynnusandcols-2

Cam 4: Yn y Rhesi a Cholofnau grŵp, cliciwch Delete Rows neu Dileu Colofnau.

doc-tynnusandcols-3


Tynnwch yr holl resi a cholofnau gwag o dablau trwy ddefnyddio cod VBA

Mae Swyddogaeth Macro Gair yn darparu ffordd lawer mwy cyfleus i gael gwared ar yr holl resi a cholofnau gwag o dablau mewn dogfen. Gallwch chi gael gwared ar yr holl resi a cholofnau gwag fel a ganlyn.

Cam 1: Gwasgwch “Alt-F11” i agor ffenestr Microsoft Visual Basic for Application;

Cam 2: Cliciwch Modiwlau ar y Mewnosod tabio, copïo a gludo'r cod VBA canlynol i mewn i ffenestr y Modiwl;

Cam 3: Yna cliciwch Rundoc-reverse-arwydd-6 botwm i gymhwyso'r VBA.

Y cod VBA i gael gwared ar yr holl resi a cholofnau gwag o dablau:

Is DeleteEmptyTablerowsandcolumns ()
Application.ScreenUpdating = Anghywir
Dim Tbl Fel Tabl, cel Fel Cell, i Mor Hir, n Mor Hir, fEmpty Fel Boole
Gyda ActiveDocument
Ar gyfer Pob Tbl Mewn. Tablau
n = Tbl.Columns.Count
Ar gyfer i = n I 1 Cam -1
fEmpty = Gwir
Ar gyfer Pob cel Yn Tbl.Columns (i) .Cells
Os Len (cel.Range.Text)> 2 Yna
fEmpty = Anghywir
Allanfa Ar Gyfer
Gorffennwch Os
Cel nesaf
Os fEmpty = Gwir Yna Tbl.Columns (i). Dileu
Nesaf i
Tbl nesaf
Diwedd Gyda
Gyda ActiveDocument
Ar gyfer Pob Tbl Mewn. Tablau
n = Tbl.Rows.Count
Ar gyfer i = n I 1 Cam -1
fEmpty = Gwir
Ar gyfer Pob cel Yn Tbl.Rows (i) .Cells
Os Len (cel.Range.Text)> 2 Yna
fEmpty = Anghywir
Allanfa Ar Gyfer
Gorffennwch Os
Cel nesaf
Os fEmpty = Gwir Yna Tbl.Rows (i). Dileu
Nesaf i
Tbl nesaf
Diwedd Gyda
Gosod cel = Dim byd: Gosod Tbl = Dim byd
Application.ScreenUpdating = Gwir
Is-End


Tynnwch yr holl resi a cholofnau gwag o dablau gydag un clic

Mae Kutools ar gyfer Word yn darparu'r ffordd fwyaf cyfleus i chi gael gwared ar yr holl resi a cholofnau gwag o dablau yn y ddogfen. 'Ch jyst angen i chi glicio unwaith, a Kutools am Word's Delete Rows/Columns bydd cyfleustodau yn tynnu pob rhes a cholofn wag o'r holl dablau selecetd i chi yn gyflym.

Kutools am Word, gyda mwy na  swyddogaethau defnyddiol, yn gwneud eich swyddi yn haws. 

Ar ôl gosod Kutools ar gyfer Word, gwnewch fel isod:(Lawrlwythiad Am Ddim Kutools ar gyfer Word Nawr!)

1. Cliciwch Kutools Byd Gwaith > Delete Rows/Columns ar y Table pane.

doc yn tynnu colofnau rhesi gwag o dabl 1

2. Yna mae deialog yn ymddangos, dewiswch y cwmpas rydych chi am dynnu tablau ohono yn yr adran Edrych i mewn, yna gwiriwch Row opsiwn a Rhes wag opsiwn, neu wirio Colofn opsiwn a Rhes wag opsiwn yn ôl yr angen. Os ydych chi am ddileu'r holl resi a cholofnau gwag, mae angen i chi gymhwyso'r llawdriniaeth hon ddwywaith.

mae kutools doc yn tynnu rhesi gwag 2  mae kutools doc yn tynnu rhesi gwag 3 

Nawr mae deialog yn galw allan i'ch atgoffa faint o dablau sydd wedi cael eu trin, cliciwch OK i gau, ac mae'r rhesi a'r colofnau gwag wedi'u tynnu o fyrddau.
mae kutools doc yn tynnu rhesi gwag 4

Awgrym.Os ydych chi am dynnu rhesi gwag o ddalen Excel, mae'r Dileu Rhesi Gwag gall cyfleustodau Kutools ar gyfer Excel eich helpu chi.

Offer Cynhyrchiant Swyddfa Gorau

Kutools am Word - Dyrchafu Eich Profiad Word gyda Dros 100 Nodweddion Rhyfeddol!

🤖 Cynorthwy-ydd Kutools AI: Trawsnewidiwch eich ysgrifennu gydag AI - Cynhyrchu Cynnwys  /  Ailysgrifennu Testun  /  Crynhoi Dogfennau  /  Ymholwch am Wybodaeth yn seiliedig ar Ddogfen, i gyd o fewn Word

📘 Meistrolaeth Dogfen: Tudalennau Hollti  /  Uno Dogfennau  /  Dewis Allforio mewn Fformatau Amrywiol (PDF/TXT/DOC/HTML...)  /  Trosi swp i PDF  /  Allforio Tudalennau fel Delweddau  /  Argraffu Ffeiliau Lluosog ar unwaith...

Golygu Cynnwys: Swp Dod o Hyd i ac Amnewid ar draws Ffeiliau Lluosog  /  Newid Maint Pob Llun  /  Trawsosod Rhesi Bwrdd a Cholofnau  /  Trosi Tabl i Testun...

🧹 Ymdrech Glân: swap i ffwrdd Mannau Ychwanegol  /  Toriadau Adran  /  Pob Pennawd  /  Blychau Testun  /  hypergysylltiadau  / Am fwy o offer tynnu, ewch i'n Dileu Grŵp...

Mewnosodiadau Creadigol: mewnosod Mil o Wahanwyr  /  Blychau Gwirio  /  Botymau Radio  /  Cod QR  /  Cod Bar  /  Tabl Llinell Lletraws  /  Pennawd Hafaliad  /  Capsiwn Delwedd  /  Pennawd Tabl  /  Lluniau Lluosog  / Darganfod mwy yn y Mewnosod Grŵp...

🔍 Detholiadau Manwl: pinbwynt tudalennau penodol  /  tablau  /  siapiau  /  paragraffau pennawd  / Gwella llywio gyda mwy Dewiswch nodweddion...

Gwelliannau Seren: Llywiwch yn gyflym i unrhyw leoliad  /  auto-mewnosod testun ailadroddus  /  toglo'n ddi-dor rhwng ffenestri dogfennau  /  11 Offer Trosi...

???? Eisiau rhoi cynnig ar y nodweddion hyn? Mae Kutools ar gyfer Word yn cynnig a Treial am ddim 60-dydd, heb unrhyw gyfyngiadau! 🚀
 
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