That’s a very original use of comments!
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
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 18 years, 3 months ago.
Viewing 1 reply threadAuthorReplies-
WSRudi
AskWoody LoungerJanuary 26, 2006 at 7:21 pm #858527Hi 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 LoungerJanuary 24, 2006 at 3:58 pm #996285Here’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 LoungerJanuary 26, 2006 at 5:33 am #996626Hi 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 LoungerJanuary 26, 2006 at 7:59 am #996640Excel 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 LoungerJanuary 27, 2006 at 6:15 pm #996977Try 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 LoungerJanuary 26, 2006 at 6:17 pm #996766This 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 LoungerJanuary 26, 2006 at 7:16 pm #996777Does 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 LoungerJanuary 29, 2006 at 4:57 pm #997137I 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 LoungerJanuary 29, 2006 at 5:29 pm #997140(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 LoungerJanuary 30, 2006 at 7:11 am #997222Hi 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 LoungerJanuary 30, 2006 at 7:44 am #997223Within 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 LoungerFebruary 9, 2007 at 9:31 am #1050719I 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 LoungerWSpooja
AskWoody LoungerWSRudi
AskWoody LoungerJanuary 26, 2006 at 7:21 pm #858528Hi 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
-
Can’t make Opera my default browser
by
bmeacham
40 minutes ago -
Do not Fall For This Purdentix Scam (Awaiting moderation)
by
elizabethkaur56
3 hours, 13 minutes ago -
*Some settings are managed by your organization
by
rlowe44
13 hours, 12 minutes ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
15 hours, 26 minutes ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
15 hours, 51 minutes ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
1 day ago -
AI slop
by
Susan Bradley
1 day ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
1 day, 2 hours ago -
Two blank icons
by
CR2
11 hours, 41 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
1 day, 11 hours ago -
End of 10
by
Alex5723
1 day, 13 hours ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
11 hours, 37 minutes ago -
test post
by
gtd12345
1 day, 19 hours ago -
Privacy and the Real ID
by
Susan Bradley
1 day, 9 hours ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
1 day, 1 hour ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
2 days ago -
Upgrading from Win 10
by
WSjcgc50
11 hours, 47 minutes ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
15 hours, 20 minutes ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
2 days, 15 hours ago -
The story of Windows Longhorn
by
Cybertooth
2 days, 3 hours ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
2 days, 17 hours ago -
Are manuals extinct?
by
Susan Bradley
3 hours, 18 minutes ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
3 days, 2 hours ago -
Network Issue
by
Casey H
2 days, 13 hours ago -
Fedora Linux is now an official WSL distro
by
Alex5723
3 days, 14 hours ago -
May 2025 Office non-Security updates
by
PKCano
3 days, 15 hours ago -
Windows 10 filehistory including onedrive folder
by
Steve Bondy
3 days, 17 hours ago -
pages print on restart (Win 11 23H2)
by
cyraxote
2 days, 18 hours ago -
Windows 11 Insider Preview build 26200.5581 released to DEV
by
joep517
3 days, 19 hours ago -
Windows 11 Insider Preview build 26120.3950 (24H2) released to BETA
by
joep517
3 days, 19 hours ago
Recent blog posts
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-2025 by AskWoody Tech LLC. All Rights Reserved.