5 Quick Methods to Batch Delete Multiple Rows or Columns in Your Word Table

In this article, we would like to show you 5 quick methods to batch delete multiple rows or columns in your Word table.

We put data into tables to make document easy to the eye. It’s not uncommon to create a long table. However, when you check the table again and find some rows and columns unnecessary, you will need a quick way to remove them.Batch Delete Multiple Rows or Columns in Your Word Table

First let’s look at ways to delete multiple consecutive rows or columns.

Method 1: Delete Rows or Columns through Contextual Menu

  1. Firstly, select a series of rows or columns and right click.
  2. Then choose “Delete Rows” or “Delete Columns” accordingly.    Right Click and Choose "Delete Rows"
  3. Or you can select rows or columns and click “Layout”.
  4. Then choose “Delete” and select “Delete Columns” or “Delete Rows”.Click "Layout"->Click "Delete"->Choose "Delete Columns" or "Delete Rows"

Method 2: Use Shortcuts

  1. Firstly, select rows or columns.
  2. Secondly, press “Backspace”.

Now if the columns or rows are non-consecutive, we cannot delete them using above methods. Instead, you can deploy following methods.

Method 3: Put Unnecessary Rows or Columns Together

  1. Select a row or column first.
  2. Then click mouse and hold on.
  3. Drag the mouse to a proper position and release.
  4. Then select all target rows or columns and using above methods to delete them.

Method 4: Run a Macro to Delete Multiple Non-consecutive Rows

  1. First and foremost, select rows.
  2. Press “Alt+ F11” to open VBA editor in Word.
  3. Then create a module by clicking “Normal’’ project.
  4. Next click “Insert” and choose “Module”.Click "Normal"->Click "Insert"->Click "Module"
  5. Open the module with double click and paste following codes:
Sub DeleteNonConsecutiveRows()
  Dim objCell As Cell
  Dim objTable As Table
  Dim nIndex As Integer, nRows As Integer
  Dim strTable As String
  Dim varCellEmpty As Boolean
 
  Application.ScreenUpdating = False
 
  '  Delete contents in selected rows.
  Selection.Delete
 
  With Selection.Tables(1)
    nRows = .Rows.Count
    For nIndex = nRows To 1 Step -1
      For Each objCell In .Rows(nIndex).Cells
        If Len(objCell.Range.Text) > 2 Then
          varCellEmpty = False
          Exit For
        Else
          varCellEmpty = True
          .Rows(nIndex).Delete
        End If
      Next objCell
    Next nIndex
  End With
 
  Set objCell = Nothing
  Set objTable = Nothing
 
  Application.ScreenUpdating = True
End Sub
  1. Last but not the least, click “Run” or hit “F5”.Paste Codes->Click "Run"

Method 5: Run a Macro to Delete Multiple Non-consecutive Columns

  1. First of all, select target columns with “Ctrl” key.
  2. Next install and run a macro following exact same steps above.
  3. But replace macro with this one:
Sub DeleteNonConsecutiveColumns()
  Dim objCell As Cell
  Dim objTable As Table
  Dim nIndex As Integer, nColumns As Integer
  Dim strTable As String
  Dim varCellEmpty As Boolean
 
  Application.ScreenUpdating = False
 
  '  Delete contents in selected columns.
  Selection.Delete
 
  With Selection.Tables(1)
    nColumns = .Columns.Count
    For nIndex = nColumns To 1 Step -1
 
      For Each objCell In .Columns(nIndex).Cells
        If Len(objCell.Range.Text) > 2 Then
          varCellEmpty = False
          Exit For
        Else
          varCellEmpty = True
          .Columns(nIndex).Delete
        End If
      Next objCell
    Next nIndex
  End With
 
  Set objCell = Nothing
  Set objTable = Nothing
 
  Application.ScreenUpdating = True
End Sub

Watch out Document Corruption

With the increase use of digital storage device, it’s important to take care of data. One of the best ways is to back them up. For example, while using Word, it can stop responding all of a sudden. And when it’s back to normal, you can only find your document dead. And then you will have to go through all the fuss of docx recovery.

Author Introduction:

Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including xlsx fix and pdf repair software products. For more information visit www.datanumen.com

Leave a Reply

Your email address will not be published. Required fields are marked *