Sub AddABunch()
For Each cell In Selection
Pics = "z:\" & cell.Value & ".jpg"
With cell.AddComment
If Dir(Pics) = "" Then
Else
.Shape.Fill.UserPicture PictureFile:=Pics
.Shape.Height = 300
.Shape.Width = 200
End If
End With
Next cell
End Sub
_______________________________________
先全部选中含有图片名字的表格,然后运行宏,其中Pics = "z:\" & cell.Value & ".jpg" 为图片地址。