Vertically and Horizontally Align text in tables

G

Guest

How do I programmatically align text in tables so that it's centered
vertically and horizontally.

Thanks,
Barb Reinhardt
 
G

Guest

Hi Barb

Did you solve the gradient fill macro? (We can help if you didn't Email me)

This code will set all tables in the pres to middle centred text

Sub tablealign()
On Error GoTo errhandler
Dim Icol As Integer, Irow As Integer, oshp As Shape, osld As Slide
For Each osld In ActivePresentation.Slides
For Each oshp In osld.Shapes
If oshp.Type = msoTable Then
With oshp.table
For Irow = 1 To .Rows.Count
For IColumn = 1 To .Columns.Count
With .Cell(Irow, IColumn).Shape.TextFrame
..HorizontalAnchor = msoAnchorCenter
..VerticalAnchor = msoAnchorMiddle
End With
Next IColumn
Next Irow
End With
End If
Next
Next
Exit Sub
errhandler:
MsgBox "sorry there's an error!", vbCritical, "www.PPTAlchemy.co.uk"
End Sub
 
G

Guest

Thanks. I got the gradients working. I just couldn't figure out the anchor
issue.

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top