ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with adding hyperlinks to images (https://www.excelbanter.com/excel-programming/453232-help-adding-hyperlinks-images.html)

PA[_2_]

Help with adding hyperlinks to images
 
Hi,

I have a code to add hundreds of pictures to a sheet. It works perfectly! Now I need to modify it to add a hyperlink to each picture and I cannot get it to work. Any help is appreciated! The hyperlink is the same link that contains the picture, in this script is the variable FILENAME

Line_dest = n - 1
Filename = Sheets("LISTOFLINKS").Cells(n, 15).Value
Rows(Line_dest).RowHeight = 100
ActiveSheet.Pictures.Insert(Filename).Select
Set shp = Selection.ShapeRange.Item(1)
With shp
.LockAspectRatio = msoTrue
.Width = 180
If .Height 95 Then .Height = 95
.Cut
End With
Selection.Hyperlinks.Add Anchor:=Selection.ShapeRange.Item(1), Address:=Filename

Thanks


All times are GMT +1. The time now is 01:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com