A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Converting Rows to columns



 
 
Thread Tools Display Modes
  #1  
Old November 10th, 2007, 08:17 PM posted to microsoft.public.word.tables
eraksoy
external usenet poster
 
Posts: 2
Default 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  
Old November 10th, 2007, 08:41 PM posted to microsoft.public.word.tables
Herb Tyson [MVP]
external usenet poster
 
Posts: 3,614
Default 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  
Old November 10th, 2007, 09:43 PM posted to microsoft.public.word.tables
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default 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  
Old November 10th, 2007, 10:25 PM posted to microsoft.public.word.tables
eraksoy
external usenet poster
 
Posts: 2
Default 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  
Old November 11th, 2007, 12:06 AM posted to microsoft.public.word.tables
Herb Tyson [MVP]
external usenet poster
 
Posts: 3,614
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:49 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.