Link to home
Start Free TrialLog in
Avatar of badrhino
badrhinoFlag for United States of America

asked on

Align-right text in PowerPoint table VBA

Currently I'm using VBA to add a table and populate it (connecting to database). Everything works perfect.  However,  I need to align right the text in the cells and I haven't been able to find out how to do this.  Obviously It works just find if I find the align right button on the ribbon, but I need to do this using vba.  I can find out how to center it, but not right align.  Currently this is what I have:
                 With .Cell(iRow, iColumn).Shape.TextFrame
                    '.VerticalAnchor = msoAnchorMiddle
                    .HorizontalAnchor = msoAnchorCenter
                End With

Any Ideas?
Avatar of John Wilson
John Wilson
Flag of United Kingdom of Great Britain and Northern Ireland image

Try

With .Cell(iRow, iColumn, 1).Shape.TextFrame
.TextRange.ParagraphFormat.Alignment = ppAlignRight
End With

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of John Wilson
John Wilson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of badrhino

ASKER

Works Perfect.  Thanks!