View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Kuo[_3_] Sam Kuo[_3_] is offline
external usenet poster
 
Posts: 86
Default How to insert a picture's address as hyperlink to a cell?

I use the script below to allow user to click on a command button to open the
"Insert Picture" pop-up window and pick a picture to be inserted into a
particular merged cell.

I wonder if it's possible to also dynamically insert the picture's address
as a hyperlink to a different cell after the picture is inserted, and how?

Thanks in advance :-)

**************
' This is a simplified version of my script, without the irrelevant lines to
this question

Sub CommandButton_Click()
Const MY_PIC As String = "MyPic"
Dim ImageCell As Range
Set ImageCell = Sheet3.Range("B10").MergeArea

ImageCell.Select

Application.Dialogs(xlDialogInsertPicture).Show
If TypeName(Selection) < "Picture" Then Exit Sub

On Error Resume Next
ActiveSheet.Shapes(MY_PIC).Delete
On Error GoTo 0

With Selection
.Name = MY_PIC
End With
End Sub