LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
Debra Dalgleish
 
Posts: n/a
Default Graphic within Cell Comment (revisited)

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:

http://www.contextures.com/xlcomments03.html#Picture

No Spam wrote:
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



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cell color based upon cell value My View Excel Discussion (Misc queries) 11 July 6th 05 03:59 AM
cell color index comparison MINAL ZUNKE New Users to Excel 1 June 30th 05 07:11 AM
how can i automatically insert cell values into a comment field? spot987654321 Excel Discussion (Misc queries) 1 June 3rd 05 11:10 PM
How do I copy text from a cell into a comment? Catnip Excel Discussion (Misc queries) 1 May 27th 05 02:12 PM
How can I move the comment box to the left of the cell? Frederic Excel Worksheet Functions 0 May 25th 05 02:25 PM


All times are GMT +1. The time now is 12:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"