View Single Post
  #3   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP
 
Posts: n/a
Default convert columns into rows

One day when in re-inventing the wheel mode, I created

' 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
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

"GreenEyedMedusa" wrote in
message ...
I really love the table function in Word; however, sometimes I've found
that
I need to convert a row into a column or a column into a row and can't do
it!
I really think that whatever new version of Word should have this
function.

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow
this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...ic.word.tables