+ Reply to Thread
Results 1 to 3 of 3

Insert newest Picture in folder into Spreadsheet

  1. #1
    Registered User
    Join Date
    06-18-2012
    Location
    stoke
    MS-Off Ver
    Excel 2007
    Posts
    3

    Insert newest Picture in folder into Spreadsheet

    Hi,
    I wonder if anyone can help?

    I am trying to figure out how to insert the newest JPG file from a given folder into a certain location in a spreadsheet.

    The pictures are images captured from a camera which are inserted as JPG files into the same folder each time.
    I need to be able to insert the most recent file into the spreadsheet.

    Any help would be appreciated

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Insert newest Picture in folder into Spreadsheet

    123rich456,

    Welcome to the forum!
    Give the below code a try. When you run it, you'll be asked to select the folder containing the JPG files. After that, you'll be asked to select the cell that the picture will be placed in. This is the cell that will have the top-left corner of the image.
    Please Login or Register  to view this content.


    How to use a macro:
    1. Make a copy of the workbook the macro will be run on
      • Always run new code on a workbook copy, just in case the code doesn't run smoothly
      • This is especially true of any code that deletes anything
    2. In the copied workbook, press ALT+F11 to open the Visual Basic Editor
    3. Insert | Module
    4. Copy the provided code and paste into the module
    5. Close the Visual Basic Editor
    6. In Excel, press ALT+F8 to bring up the list of available macros to run
    7. Double-click the desired macro (I named this one Insert_Newest_JPG)
    Last edited by tigeravatar; 06-18-2012 at 02:25 PM.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Insert newest Picture in folder into Spreadsheet

    Alter path to Suit
    Code places the latest JPG on sheet.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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