如何在excel2010批量批注插图片

请给我个代码,谢谢
2024-12-16 04:38:18
推荐回答(1个)
回答1:

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" 为图片地址。