Home |
Search |
Today's Posts |
#4
Posted to microsoft.public.word.tables
|
|||
|
|||
How do I invert a table in Word?
Here's a macro that will do it in Word
' Transposer Macro ' Macro creaeted 18/01/1999 by Doug Robbins ' 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 -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "Ranjiv" wrote in message ... I am using Microsoft Office 2003 Professional. I want to invert a table - i.e. make the columns into rows, and the rows into columns. How can I do this? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
HOW DO I INVERT A TABLE in word 2007? | Tables | |||
How do I invert text using Word 2007 Vista? | Microsoft Word Help | |||
Is there a way to invert text in a Word document? | Microsoft Word Help | |||
How can you invert text in Word documents? | Microsoft Word Help | |||
How do you invert text in Word documents? | Microsoft Word Help |