Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 05-02-2025, 04:09 PM
macropod's Avatar
macropod macropod is offline Table formatting issue: Windows 10 Table formatting issue: Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,379
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:
Code:
Sub CellMerge()
Application.ScreenUpdating = False
Dim Tbl As Table, Cll As Cell
For Each Tbl In ActiveDocument.Tables
  For Each Cll In Tbl.Range.Cells
    With Cll
      If .ColumnIndex < Tbl.Columns.Count Then
        If .Borders(wdBorderBottom).LineStyle = wdLineStyleNone And _
          .Borders(wdBorderTop).LineStyle = wdLineStyleNone Then
          .Merge MergeTo:=Tbl.Cell(Row:=.RowIndex + 1, Column:=.ColumnIndex)
          .Merge MergeTo:=Tbl.Cell(Row:=.RowIndex - 1, Column:=.ColumnIndex)
        End If
      End If
    End With
  Next
Next
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
table borders



Similar Threads
Thread Thread Starter Forum Replies Last Post
Table formatting issue: Table Formatting Issue tomohawk Excel 2 02-03-2023 08:24 AM
Table formatting issue: Irritating formatting issue in Table of Contents - page number "dots" disappear Eriks Word 9 04-19-2019 06:18 PM
Table formatting issue: Table style - first, last and odd column formatting issue BartS Word Tables 2 08-16-2016 04:10 AM
TOC Formatting Issue Caroline Word 1 03-15-2011 01:59 PM
TOC Formatting Issue Angstromm Word 0 09-22-2010 11:49 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:11 AM.


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