Excel, how do I set up default comment containing picture?

G

Guest

I've tried right-clicking on the comment & selecting "set auto shape
defaults, to no avail. Is it possible to set up a default comment, containing
a picture, to save having to edit every comment?
 
D

Dave Peterson

Maybe you could just create your default comment once, then
edit|copy
edit|paste special|Comments
whenever you need that special comment.
 
G

Guest

Thanks for the suggestion Dave, that's what I currently do. I suppose I'm
just being lazy wanting the system to do it for me.
 
D

Dave Peterson

You could always put a comment in your personal.xls (sheet1?), then use a macro
to copy|paste that comment.
 
G

Guest

I tried that a while ago & it didn't work. I can't remember what the problem
was, now. I'll give it another go.
thanks very much anyway.
 
D

Debra Dalgleish

Or you could record a macro while you add the comment with a picture,
and run that when you need it. Put the code in a workbook that's always
open, and add a button to one of your toolbars, to run the macro.

Then, select a cell and click the button.

pjk@boro said:
I tried that a while ago & it didn't work. I can't remember what the problem
was, now. I'll give it another go.
thanks very much anyway.

:
 
G

Guest

I've just tried that but got the message, "Run-time error '438'. Object
doesn't support this property or method.

Debra Dalgleish said:
Or you could record a macro while you add the comment with a picture,
and run that when you need it. Put the code in a workbook that's always
open, and add a button to one of your toolbars, to run the macro.

Then, select a cell and click the button.
 
D

Debra Dalgleish

The following code adds a comment with a picture in the c:\Data folder.
You could change that to the path and name of your picture.

'==========================
Sub CommentAddPic()
'adds formatted comment with picture
Dim cmt As Comment
Set cmt = ActiveCell.Comment
If cmt Is Nothing Then
ActiveCell.AddComment Text:=""
Set cmt = ActiveCell.Comment
With cmt.Shape.TextFrame.Characters.Font
.Bold = False
.ColorIndex = 0
End With
cmt.Shape.Fill.UserPicture "C:\Data\TestPic.jpg"
End If
End Sub
'==========================
 
G

Guest

Debra,
I've copied your formula but when I try to run it, the apostrophe above the
line
"Sub CommentAddPic()" is highlighted & I get the message "Compile error
Expected End Sub".
 
D

Dave Peterson

I think you pasted Debra's code into the middle of another procedure.

Remove that pasted code and add it to the bottom of the module--or put it in a
different module???
 

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