Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2008

Tip: Looking for answers? Try searching our database.

Table Columns

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Summer - 28 Jan 2008 05:04 GMT
Hi, I have 5 table columns 1 header row. Just text in all 5 columns.

I want to pick up ALL the words in Column 1 and put them in Column 2 at end
of cell for whole table

Is there a macro fix? Just showing first 2 columns
col 1                                 col 2
     Bateau Bay Beach
    1000 Market Street

Then col 2 looks like below and Col stays the same
col 1                                 col 2
     NSW Bateau Bay Beach
    1000 Market Street

     NSW Bateau Bay Beach

Many thanks for any assist!
Graham Mayor - 28 Jan 2008 10:13 GMT
Your layout doesn't translate to a text message.
Just to clarify, do you want to place the content of  A2 to A6 in cell B6,
or do you want to place it in new rows B7 -B11 so your resulting table would
have 10 rows plus a header with the A column after the B column?

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

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

> Hi, I have 5 table columns 1 header row. Just text in all 5 columns.
>
[quoted text clipped - 14 lines]
>
> Many thanks for any assist!
Summer - 28 Jan 2008 11:05 GMT
Sorry, it was a mess!

A1    B1    C1    D1    E1

text    text    text    text    text

Take a COPY of text in A1 and PASTE in B1 cell with a
hard return before the paste.

So copy A1 to B1, A2 to B2 etc to end of Column A.

Thanks Graham

> Your layout doesn't translate to a text message.
> Just to clarify, do you want to place the content of  A2 to A6 in cell B6,
[quoted text clipped - 19 lines]
>>
>> Many thanks for any assist!
Graham Mayor - 28 Jan 2008 11:57 GMT
Do you want the original B column text to remain or do you want to replace
it?

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

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

> Sorry, it was a mess!
>
[quoted text clipped - 39 lines]
>>>
>>> Many thanks for any assist!
Summer - 28 Jan 2008 12:11 GMT
I want to keep B text and paste A text but insert a return (pilcrow) first
before the paste?   Is that doable?

> Do you want the original B column text to remain or do you want to replace
> it?
[quoted text clipped - 42 lines]
>>>>
>>>> Many thanks for any assist!
Graham Mayor - 28 Jan 2008 12:29 GMT
I am sure it will be, but I'll have to think about it :)

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

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

> I want to keep B text and paste A text but insert a return (pilcrow)
> first before the paste?   Is that doable?
[quoted text clipped - 52 lines]
>>>>>
>>>>> Many thanks for any assist!
Graham Mayor - 28 Jan 2008 12:49 GMT
How about

Dim RefDoc As Document
Dim cTable As Table
Dim oldPart As Range, newPart As Range
Dim i As Long

Set RefDoc = ActiveDocument
Set cTable = RefDoc.Tables(1)
For i = 2 To cTable.Rows.Count
   Set oldPart = cTable.Cell(i, 1).Range
   oldPart.End = oldPart.End - 1
   Set newPart = cTable.Cell(i, 2).Range
   newPart.End = newPart.End - 1

   With newPart
       With .Find
           .ClearFormatting
           .Replacement.ClearFormatting
           .Execute findText:=newPart, _
           ReplaceWith:=newPart & "^p" & oldPart, _
           replace:=wdReplaceAll, _
           MatchWildcards:=False, _
           Forward:=True, _
           Wrap:=wdFindContinue
       End With
   End With
Next i

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

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

> I want to keep B text and paste A text but insert a return (pilcrow)
> first before the paste?   Is that doable?
[quoted text clipped - 52 lines]
>>>>>
>>>>> Many thanks for any assist!
Summer - 29 Jan 2008 08:02 GMT
Very doable thank you for that Graham.
> How about
>
[quoted text clipped - 81 lines]
>>>>>>
>>>>>> Many thanks for any assist!
Graham Mayor - 29 Jan 2008 08:46 GMT
You are welcome :)

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

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

> Very doable thank you for that Graham.
>> How about
[quoted text clipped - 90 lines]
>>>>>>>
>>>>>>> Many thanks for any assist!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.