4 Effective Methods to Exclude Header Rows while Sorting the Contents of a Word Table

In today’s post, we will provide you with 4 effective methods to exclude header rows while sorting the contents of a Word table.

In Word, we prefer to use table to hold all kinds of data. Most of time, we are dealing with numbers. Then inevitably, sorting data will be one of our daily tasks. However, when doing this, you must aware that if your table contains one or more header rows. If it does, you need to pay a bit more attention.Exclude Header Rows while Sorting the Contents of a Word Table

Here are 4 ways to sort in a table.

Method 1: Sort the Contents of a Table with One Header Row

  1. If your table contains just one header row, then put cursor inside it.
  2. Then click “Layout” tab.
  3. Next click “Sort” in “Data” group to open the same name dialog box.
  4. In “Sort” box, select the “Header row” at the left-down corner.
  5. Then select a sorting rule, be it ascending or descending.
  6. Finally, click “OK”.Click "Layout"->Click "Sort"->Select "Header row"->Choose a Sorting Rule->Click "OK"

Now, if your table contains 2 or more header rows, you will need the following methods, because Word recognizes only one header row.

Method 2: Specify Header Rows

  1. First of all, select rows that you want to set as header rows.
  2. Next, click “Layout” tab, too.
  3. And click on the “Repeat Header Rows”.Select Rows->Select "Layout"->Click "Repeat Header Rows"
  4. Then deselect the rows, but make sure the cursor is in the table whose contents are to be sorted.
  5. Next click “Sort” and specify a sorting rule.
  6. Click “OK” at last.

Method 3: Select Rows to Be Sorted

  1. This time select rows that contain contents to be sorted.
  2. Then click “Sort” command.
  3. In “Sort” box, click on the combo box of “Sort by” and choose a column.
  4. And you can also set a column to sort in the “Then by” combo box.
  5. Next choose a sorting rule and click “OK”.Select Rows->Choose a Column to Sort by->Choose a Sorting Rule->Click "OK"

You may notice that you can choose a column to be sort in method 3. But you are unable to do so with the proceeding 2. So, here is the macro way, which not only allows you to specify the start of a sorting range but also a specific column to sort by.

Method 4: Run Word Macro

  1. To begin with, place cursor inside a table and press “Alt+ F11” to open VBA editor.
  2. Then click Normal” on the left column.
  3. And click “Insert” on menu bar.
  4. Select “Module” on that drop-down menu.Click "Normal"->Click "Insert"->Click "Module"
  5. Open it by double click.
  6. On the module, paste following codes:
Sub SortCurrentTable()
  Dim strRowNum As String
  Dim strSortRule As String
  Dim strField As String
  Application.ScreenUpdating = False
  strRowNum = InputBox("Enter the row number of the row which you want to start sort:", "Row Number")
  strSortRule = InputBox("Enter one of the following values:" & vbNewLine _
                & "0 for ascending" & vbNewLine & "1 for descending", "Sorting Rule")
  strField = InputBox("Enter the number of field by which you want to sort:", "Field Number")
  With Selection.Tables(1).Range
    .Start = .Rows(Int(strRowNum)).Range.Start
    .Sort SortOrder:=Int(strSortRule), FieldNumber:=Int(strField)
  End With
  Application.ScreenUpdating = True
End Sub
  1. Next click “Run” button to execute codes.Paste Codes->Click "Run"
  2. Then in the first input box prompting up, enter a row number.
  3. Click “OK” to proceed.Enter Row Number->Click "OK"
  4. And in the “Sorting Rule” box, enter a value representing sorting rule and click “OK”.Specify Sorting Rule->Click "OK"
  5. Next in “Field Number” box, enter a column number and click “OK”.Enter a Column Number ->Click "OK"

Address Document Issues

In use of Word, we are easily to encounter with different kinds of errors. Some can be fixed with a simple restart. Others, however, are more dreadful. This is extremely true when you inherit a damaged doc.Then you best shot is to get a tool to repair it.

Author Introduction:

Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including damaged Excel 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 *