That’s a very original use of comments!
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
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 Lounger -
WSpooja
AskWoody Lounger
-
-
WSRudi
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
-
.NET 8.0 Desktop Runtime (v8.0.16) – Windows x86 Installer
by
WSmeyerbos
10 hours, 8 minutes ago -
Neowin poll : What do you plan to do on Windows 10 EOS
by
Alex5723
5 hours, 52 minutes ago -
May 31, 2025—KB5062170 (OS Builds 22621.5415 and 22631.5415 Out-of-band
by
Alex5723
8 hours, 42 minutes ago -
Discover the Best AI Tools for Everything
by
Alex5723
8 hours, 51 minutes ago -
Edge Seems To Be Gaining Weight
by
bbearren
9 hours, 34 minutes ago -
Rufus is available from the MSFT Store
by
PL1
7 hours, 2 minutes ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
1 day, 9 hours ago -
KB5061768 update for Intel vPro processor
by
drmark
16 hours, 18 minutes ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
12 hours, 29 minutes ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
1 day, 5 hours ago -
Office gets current release
by
Susan Bradley
1 day, 8 hours ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
2 days, 22 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
2 days, 6 hours ago -
Stop the OneDrive defaults
by
CWBillow
2 days, 23 hours ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
3 days, 9 hours ago -
X Suspends Encrypted DMs
by
Alex5723
3 days, 11 hours ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
3 days, 11 hours ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
3 days, 12 hours ago -
OpenAI model sabotages shutdown code
by
Cybertooth
3 days, 12 hours ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
3 days ago -
Enabling Secureboot
by
ITguy
3 days, 7 hours ago -
Windows hosting exposes additional bugs
by
Susan Bradley
3 days, 20 hours ago -
No more rounded corners??
by
CWBillow
3 days, 16 hours ago -
Android 15 and IPV6
by
Win7and10
3 days, 6 hours ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
4 days, 9 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
4 days, 11 hours ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
4 days, 6 hours ago -
Windows Update orchestration platform to update all software
by
Alex5723
4 days, 19 hours ago -
May preview updates
by
Susan Bradley
4 days, 6 hours ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
3 days, 22 hours ago
Recent blog posts
Key Links
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
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.