Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 12-15-2013, 05:48 PM
macropod's Avatar
macropod macropod is offline Merge only the text in a table and keep the 2 original colums of a table Windows 7 32bit Merge only the text in a table and keep the 2 original colums of a table Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try the following. It works with a range of selected cells.
Code:
Sub CellXfer()
Application.ScreenUpdating = False
Dim i As Long, RngTbl As Range, RngCell As Range
Set RngTbl = Selection.Range
On Error Resume Next
With RngTbl
  If .Information(wdWithInTable) = True Then
    For i = 1 To .Cells.Count Step 2
      If .Cells(i).Row.Index = .Cells(i + 1).Row.Index Then
        Set RngCell = .Cells(i + 1).Range
        With RngCell
          .End = .End - 1
          .Cut
        End With
        Set RngCell = .Cells(i).Range
        With RngCell
          .End = .End - 1
          If Len(.Text) = 0 Then
            .Paste
          ElseIf .Characters.Last = vbCr Then
            .Collapse wdCollapseEnd
            .Paste
          Else
            .Characters.Last.InsertAfter vbCr
            .Collapse wdCollapseEnd
            .Paste
          End If
        End With
      End If
    Next
  End If
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
merge, table



Similar Threads
Thread Thread Starter Forum Replies Last Post
Merge only the text in a table and keep the 2 original colums of a table Mail Merge Into Dynamic Table Jag618 Mail Merge 1 03-04-2013 11:26 PM
Cannot Merge Into A Table MacDee Mail Merge 1 01-29-2013 07:21 PM
Merge only the text in a table and keep the 2 original colums of a table mail merge with table nadja Mail Merge 5 03-06-2012 05:41 PM
Merge only the text in a table and keep the 2 original colums of a table Merge Two Table in VBA donbexcel Word VBA 2 10-21-2011 11:46 AM
Merge only the text in a table and keep the 2 original colums of a table Select Text in Table but Table Gets Selected Too RBusiness Word 1 06-07-2011 04:26 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:48 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft