+ Reply to Thread
Results 1 to 8 of 8

Hyperlinking photos

  1. #1
    Registered User
    Join Date
    09-19-2013
    Location
    Eugene, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    4

    Hyperlinking photos

    I have approx. 5,000 photos in Windows Photo Viewer that I need to hyperlink into an Excel (2010) spreadsheet set up with numerous subsheets. I can do this one at a time but that will be tedious and prone to errors. How can I hyperlink larger goups (largest is 647) of photos at a time? Alternatively, if this is not possible, how might I maintain an open Hyperlink window and revert back to the last linked photo file without having to open a new window for each linkage and scroll down to the next file to be linked?
    Thanks.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Hyperlinking photos

    Are the photos named in a way you could easily reference with cells?

    You can use cell("filename") and concatenation with "&", in conjunction with the hyperlink() function to create them without using that clunky interface.

  3. #3
    Registered User
    Join Date
    09-19-2013
    Location
    Eugene, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Hyperlinking photos

    Thanks for the reply, daffodil 11. I'm not sure what you're asking regarding "easily reference with cells." All photos have different file names. The file names are not in Excel at this point ... I have used the hyperlinkage to insert the file name. I have not found a way to copy file names from Windows Photo Viewer to the spreadsheet. I also don't know what the concatenation funtion is or what it does.

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Hyperlinking photos

    Concatenation merely refers to grouping things and using the & symbol is one of them.
    I find it especially handy for systematically created a large number of formulas from a given set of values.



    You can create many hyperlinks at once this way:

    In B2, put the filepath to the folder. I have C:\Users\daffodil11\Desktop\

    Select C2, run the maco below. It will create a list of files in the folder you select. In this case, my only file is daffodil.jpg

    In D2, put ="=hyperlink("""&B2&C2&""","&""""&C2&""")"

    Click the cell, copy, in cell E 2 right click, paste values (the 123 icon).

    Now the cell actually contains =hyperlink("C:\Users\daffodil11\Desktop\daffodil.jpg",daffodil.jpg) instead of the references.

    Enter the cell using F2. Hit Enter to activate. This will convert the cell into a working hyperlink, which only displays the file name.



    It may not seem like a shortcut at first, but:
    • You could enter the filepath to that folder from B2:B5000
    • Then run the macro on C2 for all 5000 files at once
    • Then copy the formula from D2 all the way down to D5000
    • Then select all 5000 cells, copy, paste values into E2:E5000

    And then activate. Now you've hyperlinked 5000 files in just a minute or two.






    If you are unfamiliar with VB, you need to hit Alt+F11, choose Insert at the top, click Module.

    Then paste the code below into the white sheet that pops up. Close that window.

    To run the code, first highlight the cell you want to populate on, it Alt+F8, choose the GetFileNames macro, and hit okay.

    Note: There is no Undo for things macros do, so always save first.



    Please Login or Register  to view this content.
    Here's an example using files in Microsoft Office
    hyperlink mass production.xlsm
    Last edited by daffodil11; 09-19-2013 at 07:09 PM.

  5. #5
    Registered User
    Join Date
    09-19-2013
    Location
    Eugene, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Hyperlinking photos

    I believe this will work and, if it does, I'll owe you big time. Many thanks. One other question ... any way to disable that unsafe hyperlink warning?

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Hyperlinking photos

    I use a similar process for a bunch of pics I need to have hyperlinks to, and use this...

    =IF(B139="","",HYPERLINK("S:\$ folder-name Photos\"&B139&".jpg",B139))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Registered User
    Join Date
    09-19-2013
    Location
    Eugene, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Hyperlinking photos

    If this: =IF(B139="","",HYPERLINK("S:\$ folder-name Photos\"&B139&".jpg",B139)), is how to eliminate the unsafe hyperlink warning window, how do I apply it?

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Hyperlinking photos

    I run a macro to extract the file names from the folder 1st (I have it at work though, not at home, sorry), then use that formula based on the resulting file listing. I never get any hyperlink warning

  9. #9
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Hyperlinking photos

    Instead of concatenating a column of filepaths to a file name, Master Dibbins actually writes the filepath into the formula.

    I tested it out and it didn't prompt me concerning hyperlink safety.

    I added an updated example, demonstrating how to adapt it.

    fdibbins is the hyperlink master.xlsm

+ 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. Photos in Excel
    By frogboy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-04-2013, 09:49 AM
  2. photos in Excel
    By vsbhogar in forum Excel General
    Replies: 3
    Last Post: 11-25-2012, 06:12 AM
  3. Excel 2007 : Inserting Photos
    By cheiss8078 in forum Excel General
    Replies: 0
    Last Post: 06-29-2010, 10:15 AM
  4. photos on excel webpage
    By JE McGimpsey in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 04:05 AM
  5. [SOLVED] photos on excel webpage
    By Eileen in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

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