That’s a very original use of comments!
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Add pictures to a comment! (Excel 2000 >)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Add pictures to a comment! (Excel 2000 >)
- This topic has 46 replies, 13 voices, and was last updated 16 years, 10 months ago.
Viewing 1 reply threadAuthorReplies-
WSRudi
AskWoody LoungerHi all,
Ever had a list in excel, ie Employees, or Products list, and you want to display a photo of the employee or product next to the record without taking too much space or setting up links to other programs.
Ever considered using hidden comments!!!
Well it really works great for lists, just move over the comment cell to see the pic!
Here is how to do it!
1. Select a cell that contains a Comment, right-click, and from the shortcut menu, select Show Comment.
2. Select the edge of the Comment so that the Comment is surrounded by dots, not by slashes.
3. Right-click, and from the shortcut menu, select Format Comment, Colours and Lines, Fill.
4. Open the Colour box. Choose Fill Effects. Click the Picture tab, and click Select Picture.
5. Select a picture and click OK. Resize the Comment as appropriate.If you find this tip useful, let me know!!
-
WSsdckapr
AskWoody Lounger -
WSsmbs
AskWoody Lounger -
WSHansV
AskWoody LoungerHere’s a simple version. You can add error handling, more graphics file types, etc.
Sub AddPictures()
Dim i As Long
Dim cmt As Comment
Dim oCell As Range
Dim varFile As Variant
For i = ActiveSheet.Comments.Count To 1 Step -1
Set cmt = ActiveSheet.Comments(i)
If Not Intersect(cmt.Parent, Selection) Is Nothing Then
cmt.Delete
End If
Next i
For Each oCell In Selection.Cells
varFile = Application.GetOpenFilename(“Images,*.bmp;*.gif;*.jpg;*.png”)
If varFile = False Then
‘ skip this cell
Else
With oCell.AddComment
.Visible = False
.Shape.Fill.UserPicture PictureFile:=varFile
End With
End If
Next oCell
Set cmt = Nothing
Set oCell = Nothing
End Sub
-
-
-
-
WSsdckapr
AskWoody Lounger -
WSjujuraf
AskWoody Lounger -
WSRudi
AskWoody LoungerHi Jujuraf…
How do you change the shape of the comment to one of the AutoShapes figures and still retain the popup comment and red indicator. Is this something new?
I created an autoshape and added a picture to it, but it is not a comment that pops up when the mouse moves over the cell. Can you convert a autoshape into a comment or can you change the shape of a comment to an autoshape???Please clarify your statement above!
-
WSHansV
AskWoody Lounger -
WSRudi
AskWoody Lounger -
WSHansV
AskWoody LoungerExcel has a “rich” VBA object model, unlike for example Outlook. There is no single recipe for finding out what can be done, you’ll have to learn by experimenting. In this example, I looked up Comment in the Object Browser (press F2 to activate it), noticed that it has a Shape property, etc. You can also start to write code, using explicit declarations:
Dim cmt As Comment
If you then type cmt followed by a period. IntelliSense will pop up a list of properties and methods. Shape is among them. If you select that, then type a period again, IntelliSense will pop up another list, AutoShapeType among them.
-
WSrory
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSRudi
AskWoody Lounger -
WSt8ntlikly
AskWoody Lounger
-
-
-
WSjujuraf
AskWoody LoungerTry this: http://www.contextures.com/xlcomments02.html%5B/url%5D
I’ve used it before to change the shape of a comment from its usual box look. You already know how to add a picture to a comment and it’s easy enough to change it background color to a pattern too (one of the built-in ones or using any graphic file you may have).
The thing that’s annoying though is even if I use the “set autoshape defaults” after changing anything about a comment, any future comments I add still revert back to the white box. This works for non-comment shapes, however.
Deb
-
WSBilasTasol
AskWoody Lounger
-
-
WSbraddy60
AskWoody Lounger-
WSRudi
AskWoody Lounger
WSkiazd
AskWoody LoungerThis is useful, but what I am wondering is whether or not you can insert a picture into a particular cell on a spreadsheet in order that it could be used in a lookup situation on another sheet. From what I can see inserted pictures are not tied to a paraticular cell.
Basically what I want is a Name category and a picture of employees on one sheet, and then use a vlookup on another sheet which will look up the name and picture into a phone directory.
Thanks.
-
WSsdckapr
AskWoody LoungerDoes the example in post 291,936 get you started? If it is just 1 changing lookup, you would not have to name all the pics, you could use 1 name with a dynamic range using OFFSET to get the matching value.
Another option is to save the pics to a drive and then use the hyperlink function to have them open up the approriat picture via a click. The lookup would only pull the picture name and location.
Steve
-
WSRudi
AskWoody Lounger -
WSkiazd
AskWoody Lounger -
WSsmbs
AskWoody LoungerI would like to go a step further–I have noticed that if I change the row height and select “view comments” the comments do not move only their arrows point to the correct cell row —I want make the cell height the same as the comment picture so as to prevent pictures “stacking up” one on top of the other.Recording a macro manually and manually positioning the comment uses ” Selection.ShapeRange.IncrementLeft xx Selection.ShapeRange.IncrementTop yy#”. I am not sure how to use this in code in order to position the comment location relative to cell–can this be done?? Maybe it is also possible to define the comment width and height thru vba??
Many thanx
Smbs -
WSsdckapr
AskWoody Lounger(Edited by sdckapr on 29-Jan-06 13:29. Modified code and added PS)
This will go thru all the comments on a sheet. It will:
Change the width to 200
Set the top of the comment to the top of the cell
Set the height of the row to the ht of the comment.Steve
Option Explicit Sub ChangeComments() Dim cmt As Comment Dim rng As Range For Each cmt In ActiveSheet.Comments Set rng = cmt.Parent With cmt.Shape .Width = 200 .Top = rng.Top If .Height > rng.RowHeight Then rng.RowHeight = .Height End If End With Next End Sub
PS I added an IF so that the row will only be set to the comment ht if the comment ht is larger than the current ht. This will prevent later comments in a row from shrinking the row ht narrower than the max needed.
-
WSsmbs
AskWoody Lounger -
WSsdckapr
AskWoody Lounger -
WSsmbs
AskWoody Lounger -
WSsdckapr
AskWoody Lounger -
WSsmbs
AskWoody LoungerHi Steve
The leftproperty might be what I need . If I change the column width after adding a comment the comment arrows can be seen I would like to hide the comment arrows so when viewing the sheet the picture name appears to be in column 1 and the comment picture itself appears to be in column 2. Your solution works fine initially but the moment I change column width picture locations don’t follow new column widths.
Could u give me an example of using the “Left property” pls
Many thanx for your patience
Smbs -
WSHansV
AskWoody LoungerWithin the With cmt.Shape … End With block, you can add
.Left = rng.Left
to make the left edge of the comment coincide with the left edge of the cell it belongs to, or
.Left = rng.Offset(0, 1).Left
to make the left edge of the comment coincide with the left edge of the cell to the right of the cell it belongs to.
-
WSMatz
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSMatz
AskWoody LoungerI am using the following code:
Sub AddPictures() On Error Resume Next Dim cmt As Comment Dim oCell As Range Dim varFile As Variant For Each oCell In Range("Parts") oCell.Comment.Delete Next oCell For Each oCell In Range("pics") varFile = "W:Images" & oCell.Value & ".jpg" With oCell.Offset(0, -4).AddComment .Visible = False .Shape.Left = 50 ' or: oCell.Offset(0, -4).Left .Shape.Fill.UserPicture PictureFile:=varFile .Shape.Height = 250 .Shape.Width = 400 End With Next oCell Set cmt = Nothing Set oCell = Nothing End Sub
The line ‘.Shape.Left = 50’ has no effect on the position of the comment when I roll over the cell with the mouse – it always appears just to the right of the cell’s right side. I ahve tried numbers such as 10, 250, 500 etc but to no avail.
-
WSHansV
AskWoody Lounger -
WSMatz
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSsdckapr
AskWoody Lounger -
WSsmbs
AskWoody Lounger
-
-
WSHUHandEH
AskWoody Lounger-
WSRudi
AskWoody Lounger
WSpooja
AskWoody LoungerWSRudi
AskWoody LoungerHi all,
Ever had a list in excel, ie Employees, or Products list, and you want to display a photo of the employee or product next to the record without taking too much space or setting up links to other programs.
Ever considered using hidden comments!!!
Well it really works great for lists, just move over the comment cell to see the pic!
Here is how to do it!
1. Select a cell that contains a Comment, right-click, and from the shortcut menu, select Show Comment.
2. Select the edge of the Comment so that the Comment is surrounded by dots, not by slashes.
3. Right-click, and from the shortcut menu, select Format Comment, Colours and Lines, Fill.
4. Open the Colour box. Choose Fill Effects. Click the Picture tab, and click Select Picture.
5. Select a picture and click OK. Resize the Comment as appropriate.If you find this tip useful, let me know!!
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Thunderbird doesn’t open folders at most recent email in Inbox
by
LHiggins
9 minutes ago -
Three queries about the MS Outlook app on iPadOS
by
TonyC
2 hours, 44 minutes ago -
Microsoft outlook ignores the registry keys (Awaiting moderation)
by
Heri Harry
3 hours, 47 minutes ago -
Win 10 22H2 November patches: Why do I have these 4 Windows App Runtime apps?
by
WCHS
8 minutes ago -
KB5032278
by
fpefpe
8 hours, 4 minutes ago -
A web browser security testing & privacy testing tool.
by
TechTango
13 hours, 14 minutes ago -
IOS 17.1.2 looses text alert tone
by
J9438
2 hours, 14 minutes ago -
What to know about CentOS Linux EOL
by
Alex5723
19 hours, 55 minutes ago -
ESU announcement coming?
by
Susan Bradley
1 hour, 4 minutes ago -
December 2023 Office non-Security Updates
by
PKCano
14 hours, 4 minutes ago -
Widespread Printer Bug caused by Windows Store!
by
Intrepid
21 hours, 46 minutes ago -
Xbox question
by
fernlady
21 hours, 9 minutes ago -
Unfound Updates
by
rebop2020
17 hours, 50 minutes ago -
Thieves rob DC Uber Eats driver, reject Android phone for not being iPhone
by
Alex5723
19 hours, 23 minutes ago -
McAfee popup add (from micro. Store)
by
Robin Heckler
20 hours, 45 minutes ago -
Random Screen Shut Downs (Windows 11 Pro)
by
OkCarl
1 day, 8 hours ago -
CPU performance degradation after 23H2 update
by
Alex5723
1 day, 8 hours ago -
PDFgear
by
Alex5723
1 day, 9 hours ago -
I’m getting a new computer. I need instructions on setting it up CORRECTLY
by
Sly McNasty
22 hours, 48 minutes ago -
Microsoft will not activate a valid reinstall of Office 16
by
TomK
17 hours, 4 minutes ago -
Dell laptop Win 11 BLACK screen!
by
WSpfeldmann
7 hours, 3 minutes ago -
Firefox change from French to English.
by
DaveBRenn
19 hours, 34 minutes ago -
W10 22H2 Nov 2023 PT Update: No monsters here
by
Rob Kay
1 day, 8 hours ago -
Windows : Is This the End of ‘Intel Inside’ ?
by
Alex5723
1 day, 12 hours ago -
windows 10 upgrade to 11
by
ken
1 day, 17 hours ago -
WIN10 over 2 hours to boot
by
qaz
23 hours, 55 minutes ago -
How to do a Windows 11 repair install
by
Susan Bradley
1 hour, 32 minutes ago -
Ignore Susan Bradley’s Patch Watch at your peril
by
B. Livingston
1 day, 2 hours ago -
Tmas Greetings!
by
Max Stul Oppenheimer
1 day, 9 hours ago -
Microsoft Photos, Photos Legacy, and Windows 10
by
Ed Tittel
11 hours, 33 minutes ago
Recent blog posts
- December 2023 Office non-Security Updates
- How to do a Windows 11 repair install
- Ignore Susan Bradley’s Patch Watch at your peril
- Tmas Greetings!
- Microsoft Photos, Photos Legacy, and Windows 10
- Hardening your operating system
- Permanent posts for blocking Copilot
- Apple zero days fixed – November 30, 2023
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2023 by AskWoody Tech LLC. All Rights Reserved.