Table Columns

S

Summer

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!
 
G

Graham Mayor

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?

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Summer

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
 
G

Graham Mayor

Do you want the original B column text to remain or do you want to replace
it?

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Summer

I want to keep B text and paste A text but insert a return (pilcrow) first
before the paste? Is that doable?
 
G

Graham Mayor

I am sure it will be, but I'll have to think about it :)

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Graham Mayor

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


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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Summer

Very doable thank you for that Graham.
Graham Mayor said:
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


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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Graham Mayor

You are welcome :)

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top