#1   Report Post  
Posted to microsoft.public.word.tables
Enterprise Teacher Enterprise Teacher is offline
external usenet poster
 
Posts: 1
Default Word 2003

I have started a new job and been given an existing Word doc which has a
number of rows and columns. I want to use the info which has been put into
one of the columns but then use this info as a row in a new doc, i.e.,
instead of the info in the cells reading down the LHS of the page, they
become the heading row in a new doc. Can I do this easily or do I have to
laboriously cut and paste each cell? Thanks
  #2   Report Post  
Posted to microsoft.public.word.tables
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Word 2003

What you ask is fairly simple to achieve with a macro. The following will
work with any simple table regardless of the number of columns/rows. -
http://www.gmayor.com/installing_macro.htm . Select the column you want to
copy at the prompt. A new document is created with a new table with as many
columns as there are rows, with the column content as the row header as
requested.

Dim oTable As Table
Dim oTargetTable As Table
Dim oRng As Range
Dim iCol As Integer
Dim oTarget As Document
Set oTable = Selection.Tables(1)
Set oTarget = Documents.Add
Set oTargetTable = oTarget.Tables.Add(oTarget.Range, _
1, oTable.Rows.Count)
iCol = InputBox("Copy which column? 1 to " & oTable.Columns.Count)
For i = 1 To oTable.Rows.Count
Set oRng = oTable.Cell(i, iCol).Range
oRng.End = oRng.End - 1
oTargetTable.Cell(1, i).Range.Text = oRng.Text
Next i


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


"Enterprise Teacher" Enterprise wrote in
message ...
I have started a new job and been given an existing Word doc which has a
number of rows and columns. I want to use the info which has been put into
one of the columns but then use this info as a row in a new doc, i.e.,
instead of the info in the cells reading down the LHS of the page, they
become the heading row in a new doc. Can I do this easily or do I have to
laboriously cut and paste each cell? Thanks



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Merge data from Access 2003 into a multi-page Word 2003 form eastlaketech Mailmerge 1 February 20th 09 11:55 PM
Merging Word 2003 mail merge doc with Word 2003 table in Word 2007 Michelle Mailmerge 6 April 26th 08 09:37 PM
Outlook 2003 Cant send e-mail from Excel 2003 or word 2003 Andy Microsoft Word Help 7 October 25th 06 04:33 AM
Word 2003 Attachment in Outlook 2003 - changing automated view heartforhorses Microsoft Word Help 2 March 8th 05 07:37 PM
Exchange 2003 - Outlook 2003 - Word 2003 mail merge Micheline Mailmerge 1 December 2nd 04 11:51 AM


All times are GMT +1. The time now is 05:25 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"