Transpose table in Word

4

Is there a way to transpose (swap rows and columns) in post-ribbon Microsoft Word (currently using 2013)?

For example, in this table, I want the top headings to go on the left (én, te, etc), and the left headings (van, megy, jön) go to the top (obviously with the data moved also) table to be transposed

I currenly copy and paste into Excel, copy and paste again but choose the special paste option : Transpose, then copy back to word. But is there a proper way to do this natively?

transpose menu

jay

Posted 2013-05-07T17:32:10.063

Reputation: 6 287

Answers

1

I think using Excel is the only way.

András

Posted 2013-05-07T17:32:10.063

Reputation: 426

1and to correct the content: mi VAGYUNK, not VANJUNK – András – 2013-05-07T17:46:54.637

:/ I guess people don't use this option that much. lol thanks for helping out my hungarian though! – jay – 2013-05-07T18:04:50.550

1People should never use it, as it is completly wrong :) Higgy nekem, elég gyakran használom ;) – András – 2013-05-07T19:19:55.313

3

Even Microsoft suggest to use Excel for this task.

– Adam – 2013-05-08T04:26:09.477

1

Try this macro:

Sub transpose01()
'
' transpose01 Macro
'
'
' to transpose rows and columns in a table
Dim NumCols As Long, NumRows As Long, RowCounter As Long, ColCounter As Long
Dim CellText As String
NumCols = ActiveDocument.Tables(1).Columns.Count
NumRows = ActiveDocument.Tables(1).Rows.Count
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=NumCols, NumColumns:=NumRows
RowCounter = 0
While RowCounter < NumRows
ColCounter = 0
While ColCounter < NumCols
CellText = ActiveDocument.Tables(1).Cell(RowCounter + 1, ColCounter + 1).Range.Text
CellText = Left(CellText, Len(CellText) - 2)
ActiveDocument.Tables(2).Cell(ColCounter + 1, RowCounter + 1).Range.InsertBefore CellText
ColCounter = ColCounter + 1
Wend
RowCounter = RowCounter + 1
Wend '

End Sub

David French

Posted 2013-05-07T17:32:10.063

Reputation: 11

Welcome to Super User. Can you also provide a short, plain-English explanation of what this macro does (or add appropriate comments in-line with the code)? – I say Reinstate Monica – 2017-10-28T15:33:35.500

0

Any experience with this: https://www.extendoffice.com/documents/word/1413-word-transpose-rows-and-columns-table.html there maybe a fee after free trial?

tigr

Posted 2013-05-07T17:32:10.063

Reputation: 79