Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 05-28-2016, 02:26 AM
macropod's Avatar
macropod macropod is offline Merge table cells across columns but skip if column don't exist Windows 7 64bit Merge table cells across columns but skip if column don't exist 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

Slightly simpler is:
Code:
Sub CellMerge()
Application.ScreenUpdating = False
Dim Tbl As Table
For Each Tbl In ActiveDocument.Tables
  With Tbl.Rows(1)
    If .Cells.Count > 2 Then
      ActiveDocument.Range(.Cells(2).Range.Start, .Cells(3).Range.End).Cells.Merge
    End If
  End With
Next
Application.ScreenUpdating = True
End Sub
PS: When posting code, please use the code tags, indicated by the # button on the posting menu
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
merge, skip columns, table



Similar Threads
Thread Thread Starter Forum Replies Last Post
Merge table cells across columns but skip if column don't exist How do I skip automatic Numbering on merged cells in my table? Snaybot Word 1 09-28-2015 11:27 PM
Merge table cells across columns but skip if column don't exist Column text flow with table across the columns ravenns Word 3 07-11-2013 11:29 PM
How to merge two columns & replace contents of cells conditionally? mag Excel 3 10-24-2012 01:07 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:44 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