Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cell color based upon cell value | Excel Discussion (Misc queries) | |||
cell color index comparison | New Users to Excel | |||
how can i automatically insert cell values into a comment field? | Excel Discussion (Misc queries) | |||
How do I copy text from a cell into a comment? | Excel Discussion (Misc queries) | |||
How can I move the comment box to the left of the cell? | Excel Worksheet Functions |