![]() |
|
|
|
#1
|
||||
|
||||
|
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
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#2
|
|||
|
|||
|
Macropod,
let me express my greatest appreciation for your help. You are truly a terrific expert. I applied your macro and it's done wonders. Now I'm going to spend some time to understand what this macro is actually doing, because I'm not sure I have a full understanding of what's really going on. Thank you. Last edited by Aston; 05-08-2011 at 05:49 AM. Reason: Update |
|
#3
|
||||
|
||||
|
Quote:
![]() I'm glad to hear you're interested enough to want to study the code - that's a good way to build up your own skills.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
| Thread Tools | |
| Display Modes | |
|
|
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 |
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 |