VBA Macro to copy table cell content from one table to another table in a Word document

In a Word document I have two tables. Each with three rows and two columns. I need a Macro that would copy of the content of Cell 2 in Row 2 of Table 1 to Cell 2 in Row 2 of Table 2 such that the content from Table 1 is copied to whatever is already in Cell 2 of the Row 2 of Table 2.
I have tried some code (as provided in the code window) but this code replaces whatever is already in Cell 2 or Row 2 of Table 2. I would like my macro to copy from Table 1 to table 2 without replacing the previous content of the Cell 2 of Row 2 of Table 2. The image provided with this question should illustrate what I would like my Macro to do.
Thank you for your help.

Sub CopyTableCell()
'
' CopyTableCell Macro
'
' This code replaces the content of the target cell in Table 2. 


Dim paraOne As Range
Dim paraTwo As Range


Set paraOne = ActiveDocument.Tables(1).Rows(2).Cells(2).Range
Set paraTwo = ActiveDocument.Tables(2).Rows(2).Cells(2).Range

paraOne.Copy

paraTwo.Collapse wdCollapseEnd 'get to end of cell
paraTwo.Move wdCharacter, -1 'back up over cell separator
paraTwo.Paste
   
    
End Sub

Open in new window


Copy table rows
LVL 1
FaheemAhmadGulAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You may try something like this...
Sub CopyTable1ToTable2()
Dim doc As Document
Dim srcRng As Range, dstRng As Range
Dim tbl1 As Table
Dim tbl2 As Table

Set doc = ActiveDocument
Set tbl1 = doc.Tables(1)
Set tbl2 = doc.Tables(2)

Set dstRng = tbl2.Cell(2, 2).Range
dstRng.End = dstRng.End - 1
dstRng.InsertAfter " "
dstRng.Collapse 0

Set srcRng = tbl1.Cell(2, 2).Range
srcRng.End = srcRng.End - 1
dstRng.FormattedText = srcRng.FormattedText
End Sub

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
FaheemAhmadGulAuthor Commented:
Many thanks. Greatly appreciated!!!
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome Faheem! Glad I could help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VBA

From novice to tech pro — start learning today.