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.
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.
where are the images? are they in the workbook?
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.
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?
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.
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 Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
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
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!![]()
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks