If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Converting Rows to columns
How do you convert Table 1 to Table2 in Word 2003 or 2007?
No A B 1 Arrow Black 2 Air Berry Table 1 1 A Arrow B Black 2 A Air B Berry Table 2 |
#2
|
|||
|
|||
Converting Rows to columns
Cheat. Copy it to Excel. Copy/paste special in Excel choosing the Transpose
option, then copy/paste it back into Word. :-) -- Herb Tyson MS MVP Author of the Word 2007 Bible Blog: http://word2007bible.herbtyson.com Web: http://www.herbtyson.com "eraksoy" wrote in message ... How do you convert Table 1 to Table2 in Word 2003 or 2007? No A B 1 Arrow Black 2 Air Berry Table 1 1 A Arrow B Black 2 A Air B Berry Table 2 |
#3
|
|||
|
|||
Converting Rows to columns
And, if you don't like cheating:
' Transposer Macro ' Macro creaeted 18/01/1999 by Doug Robbins ' to transpose rows and columns in a table 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) - 1) 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 "eraksoy" wrote in message ... How do you convert Table 1 to Table2 in Word 2003 or 2007? No A B 1 Arrow Black 2 Air Berry Table 1 1 A Arrow B Black 2 A Air B Berry Table 2 |
#4
|
|||
|
|||
Converting Rows to columns
Dear Herb,
Thanks for your solution. Is there a way to convert Table 1 exactly into Table 2? I used Transpose function. It helped but it did not sort the table like A, B and then A,B "Herb Tyson [MVP]": Cheat. Copy it to Excel. Copy/paste special in Excel choosing the Transpose option, then copy/paste it back into Word. :-) -- Herb Tyson MS MVP Author of the Word 2007 Bible Blog: http://word2007bible.herbtyson.com Web: http://www.herbtyson.com "eraksoy" wrote in message ... How do you convert Table 1 to Table2 in Word 2003 or 2007? No A B 1 Arrow Black 2 Air Berry Table 1 1 A Arrow B Black 2 A Air B Berry Table 2 |
#5
|
|||
|
|||
Converting Rows to columns
I didn't study your 2nd table carefully before. I presumed because of the
subject line that you were transposing. Apparently not. Your example doesn't swap rows and columns... it scrambles them, and the "to" table doesn't have the same number of cells for each row: 1 A Arrow 3 cells B Black 2 cells 2 A Air 3 cells B Berry 2 cells A and B both appear twice in the 2nd table, and "No" doesn't appear at all. The two tables' symmetry doesn't match. A very specific macro might be able to do it, but I don't believe that Doug's macro would do it, either. -- Herb Tyson MS MVP Author of the Word 2007 Bible Blog: http://word2007bible.herbtyson.com Web: http://www.herbtyson.com "eraksoy" wrote in message ... Dear Herb, Thanks for your solution. Is there a way to convert Table 1 exactly into Table 2? I used Transpose function. It helped but it did not sort the table like A, B and then A,B "Herb Tyson [MVP]": Cheat. Copy it to Excel. Copy/paste special in Excel choosing the Transpose option, then copy/paste it back into Word. :-) -- Herb Tyson MS MVP Author of the Word 2007 Bible Blog: http://word2007bible.herbtyson.com Web: http://www.herbtyson.com "eraksoy" wrote in message ... How do you convert Table 1 to Table2 in Word 2003 or 2007? No A B 1 Arrow Black 2 Air Berry Table 1 1 A Arrow B Black 2 A Air B Berry Table 2 |
Thread Tools | |
Display Modes | |
|
|