PDA

View Full Version : Copy Hyperlink from Image to Text



LordDragon
07-18-2015, 01:13 PM
Greetings,

I have an inventory DataList with over 1000 items. Some of them (about 900) have an image that can be accessed via a hyperlink. The problem is the hyperlink is attached to a small camera icon.

To make the list easier to use I've created several sheets for the items on the list that can pull the information about the items when the user enters the part number on their sheet.

The problem is the image with the hyperlink is not transferring to the sheets. Plus when I edit the DataList, the images have to be removed by individually if I delete a row with one. I'm also worried that the little images are going to end up not be lined up with their respective items.

So I'm thinking the easiest thing to do might be to get rid of the little camera icons and simply put a Yes or No in the DataList to identify if there is an image of the item available.

Now my problem is copying the hyperlink from the camera icon to the word "Yes" in each row that has an image.

I tried recording a macro, it looks like it copied fine, but I don't know how to make it work for each individual image.

Here is the recorded Macro.




Sub CopyHyperlink()
'Transfer the hyperlink from the image in column E to the word "Yes" in column F.


ActiveSheet.Shapes.Range(Array("ctl00_PageBodyContent_PartTypeListView_ctrl158_Image1")).Select
Selection.ShapeRange.Item(1).Hyperlink.Address = "(Address goes here.)"
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="Address copied here.", TextToDisplay:="Yes"
End Sub


Thanks.

p45cal
07-18-2015, 01:31 PM
cross posting: http://www.mrexcel.com/forum/excel-questions/868925-copy-hyperlink-image-text.html
LordDragon, please have a read of http://www.excelguru.ca/content.php?184, it's ultimately to your advantage.

LordDragon
07-18-2015, 04:41 PM
p45cal,

Thanks for pointing out that I cross posted. I do realize I did that. However, in my defense, I posted to Mr. Excel a couple days ago and haven't had a response. I do understand that any response given would be voluntary and it is unreasonable to expect the volunteers using these sites to answer every question posted.

However, I also know, from experience, that if I post my question only in Mr. Excel than there are hundreds (if not thousands) of Excel users and experts who will not see it; simply because they don't use that site (for whatever reason). Case in point, I didn't know about excelguru until you shared the link.

The link you shared was good and informative and I understand why cross-posting can be an issue. I also understand that it is my responsibility as the poster to inform the people reviewing my post that I am cross-posting. I will be more careful about that in the future.

p45cal
07-18-2015, 05:27 PM
and I understand why cross-posting can be an issue. I also understand that it is my responsibility as the poster to inform the people reviewing my post that I am cross-posting.
…so now you need to do something at MrExcel.

Regarding your problem, it might be an idea to upload a small sample file so people don't have to guess (perhaps wrongly) what's in your sheet.