Graphic within Cell Comment (revisited)

G

Guest

A couple of years ago some kind (and very clever) person posted the
following code that allows me to paste a graphic within a cell
comment. It works very, very well. I would like to know if it's
possible to modify the code so it will take the graphic from the
current content of the Windows clipboard instead of looking for a
file?

Thanks!

/Lac/


Sub PIC()

Dim myPictureName As Variant

myPictureName = Application.GetOpenFilename _
(filefilter:="Picture
Files,*.jpg;*.bmp;*.tif;*.gif")


If myPictureName = False Then
Exit Sub 'user hit cancel
End If


With ActiveCell
'delete existing comments
If .Comment Is Nothing Then
'do nothing
Else
.Comment.Delete
End If
.AddComment
With .Comment.Shape
.Fill.Transparency = 0#
.Line.Weight = 0.75
.Line.DashStyle = msoLineSolid
.Line.Style = msoLineSingle
.Line.Transparency = 0#
.Line.Visible = msoTrue
.Line.ForeColor.RGB = RGB(0, 0, 0)
.Line.BackColor.RGB = RGB(255, 255, 255)
.Fill.Visible = msoTrue
.Fill.ForeColor.RGB = RGB(255, 255, 255)
.Fill.BackColor.SchemeColor = 80
.Fill.UserPicture myPictureName
End With
End With

End Sub
 
G

Guest

Thanks! Lot's of good info at that site. I'm not good at VBA
programming (better at cut & pasting!) but I will try to determine the
necessary mods for the macro code.

/Lac/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top