Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Transposing Table Contents.
Written by Allen Wyatt (last updated January 22, 2022)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021
If you are working with tables in a document, at some point you may find it helpful to transpose the contents of the table, so that rows become columns and columns become rows.
There is no way to do this in Word. There is, however, a way to transpose rows and columns in Excel. So, the typical method of accomplishing this task is to use both Word and Excel, using these general steps:
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (9078) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Word here: Transposing Table Contents.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
It's easy to adjust the width of table columns using the mouse, but what if you don't want to use the mouse? Adjusting ...
Discover MoreDo you use columns in your document layout? You may want to modify the widths of various columns, and Word makes the ...
Discover MoreWhen you first insert a table in your document, it extends from margin to margin. Later, after a bunch of editing and ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
2022-01-24 09:52:41
Andrew
Funny, I just had the need for this functionality just the other week, so I "hocked up" this macro to create a "transposed" table in a separate document. This is highly not robust, and could have some error checking, but that was taking me down a rabbit hole I didn't have time for.
Andy.
Sub TableTranspose()
' Rotates columns to rows and vice versa
Dim OriginalTable As Table
Dim TransposedTable As Table
Dim NewDoc As Document
Dim a As Long, b As Long
Set OriginalTable = Selection.Tables(1)
Set NewDoc = Documents.Add
Set TransposedTable = NewDoc.Tables.Add(NewDoc.Content, OriginalTable.Columns.Count, OriginalTable.Rows.Count)
For a = 1 To OriginalTable.Rows.Count
For b = 1 To OriginalTable.Columns.Count
TransposedTable.Cell(b, a).Range.Text = OriginalTable.Cell(a, b).Range.Text
Next b
Next a
TransposedTable.Select
End Sub
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments