+ Reply to Thread
Results 1 to 10 of 10

Thread: Hyperlink Multiple Images At Once?

  1. #1
    Registered User
    Join Date
    02-14-2009
    Location
    chilliwack, bc
    MS-Off Ver
    Excel 2000
    Posts
    4

    Hyperlink Multiple Images At Once?

    Hi all,

    I am completely stumped with this problem and not sure where to begin.

    I have about 20,000 hyperlinks in my excel sheet that I would like to assign to individual images.

    For example, how do I link an image in cell A2, using a hyperlink from cell B2?

    I know that if I wanted to simply hyperlink text, I would use =HYPERLINK(B2,"text"), but this reference won't work for images.

    I also know I can right click on the image and insert a hyperlink that way, but this obviously isn't practical because I am working with over 20,000 links.

    Any help would be appreciated with figuring out this monster of a task, thank you in advance!
    Last edited by vegas12; 02-15-2009 at 11:32 PM.

  2. #2
    Forum Guru mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2007/2010
    Posts
    3,004

    Re: Hyperlink Multiple Images At Once?

    Do the shape numbers correlate in any way with the row numbers? If so, it should be possible to create a macro loop using a construct similar to ..

    ActiveSheet.hyperlinks.add Anchor:=ActiveSheet.Shapes(1), Address:=    range("B1").Hyperlinks(1).Address
    Martin

    Eighty Twenty Spreadsheet Automation http://homepage.ntlworld.com/martin.rice1/ for all your Excel customisation and consulting needs.

    If my solution has saved you time and/or money, please consider donating to Cancer Research UK.

  3. #3
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,802

    Re: Hyperlink Multiple Images At Once?

    where are the images? are they in the workbook?

  4. #4
    Registered User
    Join Date
    02-14-2009
    Location
    chilliwack, bc
    MS-Off Ver
    Excel 2000
    Posts
    4

    Re: Hyperlink Multiple Images At Once?

    Yes, the images are in the worksheet next to the link I want to associate them with and the picture numbers correlate with the row numbers.

    mrice, thank you for the macro but would you mind explaining how I implement it? I tried just copy and pasting it into a new module in VBA and trying to run the macro but that didn't work. lol, forgive me as I'm a newbie when it comes to macros.

  5. #5
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,802

    Re: Hyperlink Multiple Images At Once?

    so the links are going to where? some url? some other place in workbook?
    sorry im having trouble visualising it
    got an example of a couple?

  6. #6
    Registered User
    Join Date
    02-14-2009
    Location
    chilliwack, bc
    MS-Off Ver
    Excel 2000
    Posts
    4

    Re: Hyperlink Multiple Images At Once?

    The links are going to websites. I want to have my images link to websites that are defined in another column.

    Basically I want to use the =HYPERLINK(linklocation,"friendlytext") formula but instead of using "friendlytext" I want to use images.

    Please see the attached excel file.
    I was able to make it work with this sample because I right clicked on the image and inserted a hyperlink that way, but I obviously can't do that for 20,000 images.
    Attached Files Attached Files

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & read 2007
    Posts
    15,979

    Re: Hyperlink Multiple Images At Once?

    Hello vegas12,

    Do want hyperlinks in column "A" or only the friendly text? Does not make much sense to have hyperlinks in one column and pictures with the same hyperlinks in the adjacent column.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  8. #8
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,777

    Re: Hyperlink Multiple Images At Once?

    If you want to add the cell contents in col A to the images in col B as hyperlinks,
    Sub Macro3()
        Dim shp     As Shape
    
        For Each shp In ActiveSheet.Shapes
            ActiveSheet.Hyperlinks.Add Anchor:=shp, _
                                       Address:=shp.TopLeftCell.Offset(, -1).Text
        Next shp
    End Sub
    Last edited by shg; 02-15-2009 at 01:44 PM.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  9. #9
    Registered User
    Join Date
    02-14-2009
    Location
    chilliwack, bc
    MS-Off Ver
    Excel 2000
    Posts
    4

    Re: Hyperlink Multiple Images At Once?

    shg, that macro is exactly what I needed to complete the task! Thank you to you, and everyone else that helped out, and sorry if it seemed a little confusing to explain. I'm now able to complete my project!

  10. #10
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,777

    Re: Hyperlink Multiple Images At Once?

    You’re welcome. Would you please mark the thread as Solved?

    Click the Edit button on your first post in the thread

    Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0