Paul_Hossler
10-02-2011, 02:08 PM
Working on a macro to remove table fill and cell borders as part of a larger project.
I CANNOT figure out how to remove the borders
The removing the Fill seems like it must be done a cell at a time also
What I have is:
Sub Table_Format(T As Table)
Dim r As Long, c As Long
For r = 1 To T.Rows.Count
For c = 1 To T.Columns.Count
With T.Cell(r, c)
.Borders(ppBorderBottom).Visible = msoFalse
.Borders(ppBorderTop).Visible = msoFalse
.Borders(ppBorderLeft).Visible = msoFalse
.Borders(ppBorderRight).Visible = msoFalse
.Borders(ppBorderDiagonalDown).Visible = msoFalse
.Borders(ppBorderDiagonalUp).Visible = msoFalse
.Shape.Fill.ForeColor.RGB = xlColorIndexNone
End With
Next c
Next r
End Sub
Google tells me that the .Visible 'should' work
What am I doing wrong? Thanks
Paul
I CANNOT figure out how to remove the borders
The removing the Fill seems like it must be done a cell at a time also
What I have is:
Sub Table_Format(T As Table)
Dim r As Long, c As Long
For r = 1 To T.Rows.Count
For c = 1 To T.Columns.Count
With T.Cell(r, c)
.Borders(ppBorderBottom).Visible = msoFalse
.Borders(ppBorderTop).Visible = msoFalse
.Borders(ppBorderLeft).Visible = msoFalse
.Borders(ppBorderRight).Visible = msoFalse
.Borders(ppBorderDiagonalDown).Visible = msoFalse
.Borders(ppBorderDiagonalUp).Visible = msoFalse
.Shape.Fill.ForeColor.RGB = xlColorIndexNone
End With
Next c
Next r
End Sub
Google tells me that the .Visible 'should' work
What am I doing wrong? Thanks
Paul