Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 05-08-2011, 01:26 AM
macropod's Avatar
macropod macropod is online now Problem with Cell Margins Windows 7 32bit Problem with Cell Margins Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,363
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

Hi Aston,

Although the various 'currency' cells in your table have a "Table numbers1" Style attached to them, it look like someone has been manually overriding that. Some of the 'currency' cells also have a different top/bottom padding than other 'currency' cells and the table defaults. It's these two things together that seem to be messing up the formatting. The following macro goes through all the cells with the "Table numbers1" Style attached, in all tables in the document, and re-formats them with the "Table numbers1" Style correctly applied and the cell padding the same as the table generally:
Code:
Sub FixTables()
Dim Tbl As Table, oCel As Cell, Rng As Range, bBld As Boolean
With ActiveDocument
  For Each Tbl In .Tables
    For Each oCel In Tbl.Range.Cells
      With oCel
        If .Range.Style = "Table numbers1" Then
          bBld = .Range.Font.Bold
          .TopPadding = Tbl.TopPadding
          .BottomPadding = Tbl.BottomPadding
          .RightPadding = Tbl.RightPadding
          .LeftPadding = Tbl.LeftPadding
          .Range.Style = "Table numbers1"
          .Range.Font.Bold = bBld
        End If
      End With
    Next
  Next
End With
End Sub
Note: the code captures and re-applies the font bolding for the cells concerned. If a 'bold' character Style had been applied to these cells, that wouldn't be necessary.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Inconsistent Margins judyfogarty Word 0 08-01-2010 02:54 AM
How can I fill cell color starting from Cell D5 using Conditional formatting instead Learner7 Excel 0 07-08-2010 05:50 AM
How can I make a cell color RED under the Today's date cell? Learner7 Excel 2 07-08-2010 12:52 AM
Problem with Cell Margins Margins xGAME-OVERx Word 8 10-24-2009 06:39 AM
Auto-populate an MS Word table cell with text from a diff cell? dreamrthts Word Tables 0 03-20-2009 01:49 PM

Other Forums: Access Forums

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