• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Formatting of the PPT Slide via Exel VBA

Saida G.

New Member
Dear Chandoo Community,


Problem desctiprion:

I have created a macro that transfers excel info into power point (loops through each excel worksheet and copies the selected range into ppt). My problem is rather simple, however, I am struggling with the formatting of the Slide titles as I am completelly new to writing macros. I would like to have a 2-line title for each slide (the titles are linked to the range in excel), however the formatting for the first line should be different from the second title line. For example: 1st line: Financial Year (Font size = 35); 2bd line: Cash Flow (Font size = 20). The following is the code I have so far (just the concerned part of the code):


With PPSlide

Slidename = Range("D4").Text

Slidenames = Range("D5").Text

.Shapes(1).TextFrame.TextRange.Text = Slidename & Chr(13) & Slidenames

.Shapes("Rectangle 2").TextFrame.TextRange.Font.Size = 20

.Shapes(2).Delete ' add text content

End With

PPSlide.Select


Question: What is the syntax to format the first slide title line? I have tried Rectangle 1, does not work. Currently, both of the title lines are formatted with the font size = 20.


Thanks a lot!
 
Back
Top