Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

Kutools for Excel 21.00 HOT

300+ Powerful Features You Must Have in Excel

Kutools-for-Excel

Kutools for Excel is a powerful add-in that frees you from performing time-consuming operations in Excel, such as combine sheets quickly, merge cells without losing data, paste to only visible cells, count cells by color and so on. 300+ powerful features / functions for Excel 2019, 2016, 2013, 2010, 2007 or Office 365!

Read More Download Buy now

Office Tab 14.00HOT

Adding Tabbed Interface for Office

Office Tab

It enables tabbed browsing, editing, and managing of Microsoft Office applications. You can open multiple documents / files in a single tabbed window, such as using the browser IE 8/9/10, Firefox, and Google Chrome. It's compatible with Office 2019, 2016, 2013, 2010, 2007, 2003 or Office 365. Demo

Read More Download Buy now

Kutools for Outlook 12.00NEW

100+ Powerful Features for Outlook

Kutools-for-Outlook

Kutools for Outlook is a powerful add-in that frees you from time-consuming operations which majority of Outlook users has to perform daily! It can save your time from using Microsoft Outlook 2019, 2016, 2013, 2010 or Office 365!

Read More Download Buy now

Kutools for Word  9.00NEW

100+ Powerful Features for Word

Kutools-for-Word

Kutools for Word is a powerful add-in that frees you from time-consuming operations which majority of Word users have to perform daily! It can save your time from using Microsoft Word / Office 2019, 2016, 2013, 2010, 2007, 2003 or Office 365!

Read More Download Buy now

Classic Menu for Office

Bringing Back Your Familiar Menus

Restores the old look and menus of Office 2003 to Microsoft Office 2019, 2016, 2013, 2010, 2007 or Office 365. Don’t lose time in finding commands on the new Ribbon. Easy to deploy to all computers in enterprises and organizations.

Read More Download Buy now

How to remove empty rows and columns from tables in Word?

How can you remove the all empty rows and columns from tables in Word? This tutorial will show you several ways to remove empty rows and columns from tables in Word document.

Manually remove all empty rows and columns from tables

Remove all empty rows and columns from tables by using VBA code

Remove all empty rows and columns from tables with one clickgood idea3

quickly remove all empty rows and columns in tables in Word

The Remove Empt Rows Cols utility of Kutools for Word can quickly remove all empty columns and rows of tables in the whole Word document with one click.  Click for 45 days free trial!
  doc remove empty rows columns
 
Kutools for Word: with dozens of handy Word add-ins, free to try with no limitation in 45 days.

Manually remove all empty rows and columns from tables

Microsoft Office Word does not provide a convenient way to remove empty rows and columns, and you need to remove them by manually select each empty row and column and then delete them one by one.

Step 1: Select the empty row or empty column you want to delete. See screenshot:

doc-removerowsandcols-1

Step 3: Under Table Tools, click the Layout Tab;

doc-removerowsandcols-2

Step 4: In the Rows & Columns group, click Delete Rows or Delete Columns.

doc-removerowsandcols-3


Remove all empty rows and columns from tables by using VBA code

The Macro Function of Word provides a much more convenient way to remove all empty rows and columns from tables in document. You can remove all empty rows and columns as follows.

Step 1: Press “Alt-F11” to open the Microsoft Visual Basic for Application window;

Step 2: Click Module on the Insert tab, copy and paste the following VBA code into the Module window;

Step 3: Then click Rundoc-reverse-sign-6 button to apply the VBA.

The VBA code to remove all empty rows and columns from tables:

Sub DeleteEmptyTablerowsandcolumns()
Application.ScreenUpdating = False
Dim Tbl As Table, cel As Cell, i As Long, n As Long, fEmpty As Boolean
With ActiveDocument
For Each Tbl In .Tables
n = Tbl.Columns.Count
For i = n To 1 Step -1
fEmpty = True
For Each cel In Tbl.Columns(i).Cells
If Len(cel.Range.Text) > 2 Then
fEmpty = False
Exit For
End If
Next cel
If fEmpty = True Then Tbl.Columns(i).Delete
Next i
Next Tbl
End With
With ActiveDocument
For Each Tbl In .Tables
n = Tbl.Rows.Count
For i = n To 1 Step -1
fEmpty = True
For Each cel In Tbl.Rows(i).Cells
If Len(cel.Range.Text) > 2 Then
fEmpty = False
Exit For
End If
Next cel
If fEmpty = True Then Tbl.Rows(i).Delete
Next i
Next Tbl
End With
Set cel = Nothing: Set Tbl = Nothing
Application.ScreenUpdating = True
End Sub


Remove all empty rows and columns from tables with one click

Kutools for Word provides you the most convenient way to remove all empty rows and columns from tables in document. You just need to click once, and Kutools for Word' s Remve Empty Rows Cols utility will remove all empty rows and columns from all or selecetd tables for you quickly.

Kutools for Word, with more than 100 handy functions, makes your jobs easier. 

After installing Kutools for Word, please do as below:(Free Download Kutools for Word Now!)

1. Click Enterprise > Remove empty rows and Cols on the Table pane.

doc remove blank rows columns from table 1

2. Then a dialog pops out for you to ensure remove blank rows and columns from all tables in the whole document, click Yes to continue, another dialog pops out to remind you the number of deleted rows and columns. Click Ok to close it.

  doc remove blank rows columns from table 2 doc arrow right  doc remove blank rows columns from table 3

Now the blank rows and columns have been removed from tables.

doc remove blank rows columns from table 4
doc arrow down
doc remove blank rows columns from table 5

Tip.If you want to remove blank rows from Excel sheet, the Delete Blank Rows utility of Kutools for Excel can help you.

In Excel, you can delete blank rows by selected them one by one then delete, but if there are hundreds of blank rows across the workbook, how can you quickly remove all blank rows? Here, the Delete Blank Rows utility of Kutools for Excel is aim to remove blank rows in Excel, you can choose to remove blank rows in selected range, selected sheet, current sheet or all sheets of the workbook which can do you a nice favor.
Click for 60 days free trial!
doc delete blank row
 
Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days.

Tabbed browsing & editing multiple Word documents/Excel workbooks as Firefox, Chrome, Internet Explore 10!

You may be familiar to view multiple webpages in Firefox/Chrome/IE, and switch between them by clicking corresponding tabs easily. Here, Office Tab supports similar processing, which allow you to browse multiple Word documents or Excel workbooks in one Word window or Excel window, and easily switch between them by clicking their tabs.
Click for free trial of Office Tab!

Browse multiple word documents in one window as Firefox
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    JK · 2 months ago
    You just saved me a zillion hours of frustration, THANK YOU!
  • To post as a guest, your comment is unpublished.
    helping · 1 years ago
    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,
    • To post as a guest, your comment is unpublished.
      Carol · 1 years ago
      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 :)
  • To post as a guest, your comment is unpublished.
    F · 1 years ago
    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!
  • To post as a guest, your comment is unpublished.
    GB · 3 years ago
    Hi All,

    I am looking for function in word wherein, if I remove specific word then it should remove that row as well.
  • To post as a guest, your comment is unpublished.
    Natasja · 3 years ago
    Thanks for the code, really useful.
  • To post as a guest, your comment is unpublished.
    jj511 · 4 years ago
    Is there a macro that will delete a row if only one of the cells in that row is empty or contains a zero?
  • To post as a guest, your comment is unpublished.
    heisenberg · 4 years ago
    thanks for the macro, it was really helpful..
  • To post as a guest, your comment is unpublished.
    Ken Grace · 5 years ago
    Thanks for the macro. It worked like a charm!
  • To post as a guest, your comment is unpublished.
    Andy Harris · 6 years ago
    Hello developers - I have this macro which sits in a button and when clicked (the macro) removes the table directly above the button. Can this be fixed so that the macro only works once? Ie. if there are 2 tables in the document only 1 is deleted - then the macro ceases to work... can you advise?

    Sub tableDelete()
    '
    ' tableDelete Macro
    'Dim nTables As Integer
    nTables = ActiveDocument.Tables.Count
    ActiveDocument.Tables(nTables).Delete

    '

    End Sub
    • To post as a guest, your comment is unpublished.
      Jay Chivo · 6 years ago
      [quote name="Andy Harris"]Hello developers - I have this macro which sits in a button and when clicked (the macro) removes the table directly above the button. Can this be fixed so that the macro only works once? Ie. if there are 2 tables in the document only 1 is deleted - then the macro ceases to work... can you advise?

      Sub tableDelete()

      Dim nTables As Integer
      nTables = ActiveDocument.Tables.Count
      ActiveDocument.Tables(nTables).Delete

      End Sub[/quote]

      Please try to use this VBA to delete all tables from current document in Word.

      [i]Sub tableDelete()

      Dim aTable As Table

      For Each aTable In ActiveDocument.Tables
      aTable.Delete
      Next

      End Sub[/i]

Feature Tutorials