willemeulen
12-08-2009, 02:38 AM
Just learning bit by bit :banghead: so bear a bit with me picking your brains. There are a few things I would like to modify on the code below but I just do baby steps in order to understand the damn thing.
The code below works perfectly for adding a picture into the comment box depending on the value. But I would like to get it working on cells which already have a comment. I tried to add clear comment but doesn't want to work.
Sub AddPic()
For Each cell In Selection
Pic = "C:\SCimage\shape" & cell.Value & ".jpg"
With cell.AddComment
.Shape.Fill.UserPicture Pic
.Shape.Height = 175
.Shape.Width = 300
End With
Next cell
End Sub
W: pray2:
The code below works perfectly for adding a picture into the comment box depending on the value. But I would like to get it working on cells which already have a comment. I tried to add clear comment but doesn't want to work.
Sub AddPic()
For Each cell In Selection
Pic = "C:\SCimage\shape" & cell.Value & ".jpg"
With cell.AddComment
.Shape.Fill.UserPicture Pic
.Shape.Height = 175
.Shape.Width = 300
End With
Next cell
End Sub
W: pray2: