close

There's code here that will insert the selected picture into a comment
in the active cell. You could modify it slightly, to paste the clipboard
contents at the start of the code:

www.contextures.com/xlcomments03.html#Picture

No Spam wrote:
gt; A couple of years ago some kind (and very clever) person posted the
gt; following code that allows me to paste a graphic within a cell
gt; comment. It works very, very well. I would like to know if it's
gt; possible to modify the code so it will take the graphic from the
gt; current content of the Windows clipboard instead of looking for a
gt; file?
gt;
gt; Thanks!
gt;
gt; /Lac/
gt;
gt;
gt; Sub PIC()
gt;
gt; Dim myPictureName As Variant
gt;
gt; myPictureName = Application.GetOpenFilename _
gt; (filefilter:=quot;Picture
gt; Files,*.jpg;*.bmp;*.tif;*.gifquot;)
gt;
gt;
gt; If myPictureName = False Then
gt; Exit Sub 'user hit cancel
gt; End If
gt;
gt;
gt; With ActiveCell
gt; 'delete existing comments
gt; If .Comment Is Nothing Then
gt; 'do nothing
gt; Else
gt; .Comment.Delete
gt; End If
gt; .AddComment
gt; With .Comment.Shape
gt; .Fill.Transparency = 0#
gt; .Line.Weight = 0.75
gt; .Line.DashStyle = msoLineSolid
gt; .Line.Style = msoLineSingle
gt; .Line.Transparency = 0#
gt; .Line.Visible = msoTrue
gt; .Line.ForeColor.RGB = RGB(0, 0, 0)
gt; .Line.BackColor.RGB = RGB(255, 255, 255)
gt; .Fill.Visible = msoTrue
gt; .Fill.ForeColor.RGB = RGB(255, 255, 255)
gt; .Fill.BackColor.SchemeColor = 80
gt; .Fill.UserPicture myPictureName
gt; End With
gt; End With
gt;
gt; End Sub--
Debra Dalgleish
Excel FAQ, Tips amp; Book List
www.contextures.com/tiptech.html

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()