Derek Fingleson
New Member
- Joined
- Jan 22, 2020
- Messages
- 16
- Office Version
- 365
- 2013
- Platform
- Windows
PLEASE SEE THE BOTTOM OF THIS SUB..
I'm Trying to insert code that will place a hyperlink IN the image !
The Hyperlinks are all located in Col A
The pics are loaded in Col B
--------------------------------------------
Sub loadPicture()
Dim Pic_Location As String, picNumber As Integer
Dim cellLocation As Range
Dim Pic_Name As String, totalRows As Integer
'To check totalRows in column A
totalRows = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
For picNumber = 2 To totalRows
Set cellLocation = ActiveSheet.Range("B" & picNumber)
Pic_Location = ActiveSheet.Range("A" & picNumber)
Set Pic = cellLocation.Parent.Pictures.Insert(Pic_Location)
With Pic
'.ShapeRange.LockAspectRatio = msoFalse
.Top = Cells(picNumber, 2).Top
.Left = Cells(picNumber, 2).Left
.Height = 0.9 * 72
.Hyperlinks.Add , Address:=Pic_Location ( This Fuction is Wrong ? )
End With
Next
End Sub
I'm Trying to insert code that will place a hyperlink IN the image !
The Hyperlinks are all located in Col A
The pics are loaded in Col B
--------------------------------------------
Sub loadPicture()
Dim Pic_Location As String, picNumber As Integer
Dim cellLocation As Range
Dim Pic_Name As String, totalRows As Integer
'To check totalRows in column A
totalRows = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
For picNumber = 2 To totalRows
Set cellLocation = ActiveSheet.Range("B" & picNumber)
Pic_Location = ActiveSheet.Range("A" & picNumber)
Set Pic = cellLocation.Parent.Pictures.Insert(Pic_Location)
With Pic
'.ShapeRange.LockAspectRatio = msoFalse
.Top = Cells(picNumber, 2).Top
.Left = Cells(picNumber, 2).Left
.Height = 0.9 * 72
.Hyperlinks.Add , Address:=Pic_Location ( This Fuction is Wrong ? )
End With
Next
End Sub