+ Reply to Thread
Results 1 to 2 of 2

Find/Replace Customer Name from a cell to PowerPoint

Hybrid View

  1. #1
    Registered User
    Join Date
    12-17-2014
    Location
    London, UK
    MS-Off Ver
    2016
    Posts
    54

    Find/Replace Customer Name from a cell to PowerPoint

    Hi all,

    I have the following code setup to push some charts over to a PPT Template. I want to add some code to find/replace "Customer Name" in the entire deck with whatever is in cell B2 of Sheet1.

    Sub Presentation()
    
    Dim ppt As PowerPoint.Application
    Dim pptPres As PowerPoint.Presentation
    Dim pptSld As PowerPoint.Slide
    Dim pptCL As PowerPoint.CustomLayout
    Dim pptShp As PowerPoint.Shape
    Dim strPptTemplatePath As String
    Dim cht As Chart
    Dim ws As Worksheet
    Dim i As Long
      
    strPptTemplatePath = GetFolder()
        
        
    Set ppt = CreateObject("PowerPoint.Application")
    ppt.Visible = msoTrue
    Set pptPres = ppt.Presentations.Open(strPptTemplatePath, untitled:=msoTrue)
        
    'Copy "Chart 2" on "Sheet3" to Slide # 10
            ' Copy "Chart 2" on "Sheet3" as a picture
            ActiveWorkbook.Sheets("Count by Category").ChartObjects("Chart 1").Chart.ChartArea.Copy
            ' Paste chart  to Slide # 10
            With pptPres.Slides(10).Shapes.PasteSpecial(ppPasteShape)
                ' Align pasted chart
                '.Align msoAlignCenters, True
                '.Align msoAlignLefts, True
             End With
             
    'Copy "Chart 1" on "Sheet14" to Slide # 11
            ' Copy "Chart 1" on "Sheet14" as a picture
            ActiveWorkbook.Sheets("Count by Month").ChartObjects("Chart 1").Chart.ChartArea.Copy
            ' Paste chart  to Slide # 11
            With pptPres.Slides(11).Shapes.PasteSpecial(ppPasteShape)
                ' Align pasted chart
                '.Align msoAlignCenters, True
                '.Align msoAlignLefts, True
             End With
            
    'Copy "Chart 1" to from "Sheet4" to Slide # 12
            ' Copy "Chart 1" on "Sheet4" as a picture
            ActiveWorkbook.Sheets("Category by Month (Full)").ChartObjects("Chart 1").Chart.ChartArea.Copy
            ' Paste chart  to Slide # 12
            With pptPres.Slides(12).Shapes.PasteSpecial(ppPasteShape)
               ' Align pasted chart
                '.Align msoAlignCenters, True
                '.Align msoAlignMiddles, True
            End With
            
    ' Clean up
            Set pptSld = Nothing
            Set pptPres = Nothing
            Set ppt = Nothing
            
    End Sub
    NOTE: There are 12 times of the 'Copy "Chart 1" to_ _ _Slide # 10
    Feel free to simplify my code for the Charts Export!

  2. #2
    Registered User
    Join Date
    12-17-2014
    Location
    London, UK
    MS-Off Ver
    2016
    Posts
    54

    Re: Find/Replace Customer Name from a cell to PowerPoint

    Any help on this please? Thanks, Al

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Find and replace words in PowerPoint using a Excel VBA macro
    By Rogier1234 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-23-2018, 08:58 AM
  2. Find Replace Text within PowerPoint text box?
    By nickypatterson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-22-2016, 03:41 AM
  3. Replies: 16
    Last Post: 12-02-2014, 03:38 PM
  4. using pan number of the customer find details of an customer using excel macros
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-31-2014, 03:31 PM
  5. Find and replace but replace value of cell 3 columns along
    By batchjb69 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2014, 10:57 AM
  6. replace customer number with customer name
    By openyamind in forum Excel General
    Replies: 3
    Last Post: 11-10-2011, 06:59 PM
  7. Find & Replace Powerpoint Text from Excel
    By lt0218 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-10-2011, 07:56 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1