+ Reply to Thread
Results 1 to 5 of 5

Insert batch of pictures into Powerpoint slides sorted by name

  1. #1
    Registered User
    Join Date
    11-27-2017
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    2

    Insert batch of pictures into Powerpoint slides sorted by name

    Hi ! I am new at VBA, and I have been trying to find a code to insert a batch of pictures into Powerpoint (2010) slides sorted by name. I found this code on http://www.pptfaq.com/FAQ00352_Batch..._per_slide.htm which works fine but it seems to be inserting the pictures a random order, I want the pictures to be sorted alphabetically by name like I see them when I go into the folder. Here is the code:

    Please Login or Register  to view this content.
    The file names I want in order are in this format: Image3, Image 4, Image 9, etc.

    Thank you so much!

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Insert batch of pictures into Powerpoint slides sorted by name

    Welcome to the forum
    Your file names are the issue
    They are being sorted as text 1, 11, 12, 13......2, 21, 22, 23.....3 etc

    To remove your issue rename the files to a consistent format..
    Image 001.jpg, Image 002.jpg etc

    would you like some VBA to do that? (tomorrow - UK)
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Registered User
    Join Date
    11-27-2017
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    2

    Re: Insert batch of pictures into Powerpoint slides sorted by name

    Hi !

    Yes that would definitely help! Thanks

    However, some of my files are not sequential (e.g. sometimes it goes from Image 3 to Image 6) but the image numbers need to stay the same because the user will have to know what the exact image number is.
    Last edited by plantpol; 11-28-2017 at 09:56 AM.

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Insert batch of pictures into Powerpoint slides sorted by name

    OK - been busy today. But will post something tomorrow
    Last edited by kev_; 11-29-2017 at 03:54 AM.

  5. #5
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Insert batch of pictures into Powerpoint slides sorted by name

    Sub ReName (see below) works for me
    - my sample data has not been cleared from attached workbook
    - your file names may have some oddities that you have not mentioned!
    - amended VBA TestReName also included in the attached file
    - run with {CTRL} K
    - amend the folder path first (must end with "\")
    - old values are cleared by the VBA each time
    - TestReName dumps values to the 2 worksheets but does not rename any files

    The VBA looks at all files in the folder (with *.*)
    Please Login or Register  to view this content.
    If TestReName does what you need you can either:
    - run ReName
    OR
    - amend TestReName
    Please Login or Register  to view this content.
    If TestReName does not do exactly what you need, then re-attach the workbook with your data and highlight problem names
    (there may be extra spaces etc in your file names)


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kev_; 11-29-2017 at 05:13 AM.

+ 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. PowerPoint SLides Template
    By seotivist in forum Tips and Tutorials
    Replies: 2
    Last Post: 08-09-2016, 04:27 AM
  2. PowerPoint SLides Template
    By seotivist in forum PowerPoint Formatting & General
    Replies: 0
    Last Post: 04-07-2016, 12:34 AM
  3. MACRO to create Powerpoint slides PDF
    By blackhawk4 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2013, 12:42 PM
  4. copy cells to powerpoint slides
    By just_some_guy in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-08-2010, 09:34 AM
  5. VBA to update PowerPoint slides.
    By bapatterson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2010, 01:44 PM
  6. Pasting Selected Ranges into a PowerPoint Slides
    By NaNaBoo in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-02-2009, 10:58 AM
  7. Excel formulas on different Powerpoint Slides
    By liseladele in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-31-2006, 07:28 PM

Tags for this Thread

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