Sub 圖片插入批注() On Error Resume Next Dim Rng As Range Dim Filestring As String Filestring = Application.GetOpenFilename('圖片,*.jpg;*.png;*.gif', , , , False) Set Rng = Selection Rng.AddComment (' ') With Rng.Comment .Shape.Fill.UserPicture Filestring .Shape.Width = 200 .Shape.Height = 150 End With End Sub
range('A1').comment.shape.Fill.userpicture '此處填文件路徑' range('A1').comment.shape.width=100 '批注寬設(shè)置為100 range('A1').comment.shape.height=100 ' 如需遍歷批注:可采用如下方式:
代碼運(yùn)行后效果如下: 好了,本期教程就到這里啦,走過路過的點(diǎn)個關(guān)注分享一下吧,謝謝啦 |
|