View Single Post
  #3   Report Post  
Posted to microsoft.public.word.tables
Helmut Weber
 
Posts: n/a
Default Is there a way to turn rows into columns in Word?

Hi Suzanne, hi Felicitator,

if it has to be,
just out of fun:

Sub RowColumnChange()
Dim r As Long ' row
Dim c As Long ' column
Dim st As String ' Temporary string
Dim s1 As String ' string from cell 1
Dim s2 As String ' string from cell 2
Dim t As Table
Set t = ActiveDocument.Tables(3)
With t
For r = 1 To t.Rows.Count - 1
For c = r To t.Columns.Count
s1 = t.Cell(r, c).Range.Text
s1 = left(s1, Len(s1) - 2)
s2 = t.Cell(c, r).Range.Text
s2 = left(s2, Len(s2) - 2)
st = s1
t.Cell(r, c).Range.Text = s2
t.Cell(c, r).Range.Text = st
Next
Next
End With
End Sub

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"