craig.penny
Well-known Member
- Joined
- May 8, 2009
- Messages
- 656
Hello all you Excel nerds!
I'm trying to insert a picture into a cell comment. I've found plenty of threads but they are all for situations where the picture is not already within the worksheet or workbook. This is what I've been trying with all different things in place of the "???????" but I haven't figured it out.
"Picture 2" is definitely the right name but now what?
If you read this and you don't know the answer but just have an idea I'd love to hear it!
Thanks in advance!
I'm trying to insert a picture into a cell comment. I've found plenty of threads but they are all for situations where the picture is not already within the worksheet or workbook. This is what I've been trying with all different things in place of the "???????" but I haven't figured it out.
Code:
Sub NamePic()
Dim Pic As Object
Dim Nm As String: Nm = "Picture 2"
Dim s As Worksheet: Set s = ActiveSheet
On Error Resume Next
s.Cells(1, 2).Select
Set Pic = s.Pictures(Nm)
s.Cells(1, 5).AddComment
s.Cells(1, 5).Comment.Shape.Height = Pic.Height
s.Cells(1, 5).Comment.Shape.Width = Pic.Width
s.Cells(1, 5).Comment.Shape.Fill.UserPicture ????????
End Sub
"Picture 2" is definitely the right name but now what?
If you read this and you don't know the answer but just have an idea I'd love to hear it!
Thanks in advance!