S
Sam Kuo
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
"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