• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5195
  • Last Modified:

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?
0
badrhino
Asked:
badrhino
  • 2
1 Solution
 
JSRWilsonCommented:
Try

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

Open in new window

0
 
JSRWilsonCommented:
Apology thats a typo!!

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

Open in new window

0
 
badrhinoAuthor Commented:
Works Perfect.  Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now