Sub 批注插图()
Dim cell As Range
Selection.ClearComments
For Each cell In Selection
If Dir("D:\新建文件夹\" & cell.Text & ".png") <> "" Then
With cell.AddComment
.Visible = True
.Text Text:=""
.Shape.Select True
Selection.ShapeRange.Fill.UserPicture "D:\新建文件夹\" & cell.Text & ".png"
.Shape.Width = 200 'Add these 2 statement
.Shape.Height = 300
cell.Offset(1, 0).Select
.Visible = False
End With
End If
Next
Exit Sub
err:
ActiveCell.ClearComments
MsgBox "未找到同名的JPG图片!", 64, "提示"
End Sub
Excel,VBA批注插图,图片名比单元格内容少一个"\",应该怎么改代码
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-