Written by Allen Wyatt (last updated July 10, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365
In Word, Leticia notes that you can paste a picture into a comment. She's tried to do this in Excel, but without success. She wonders if there is a way to paste a picture into an Excel comment.
There is no way to paste a picture into a comment (as you do in Word), but there is a way to make a picture appear within a comment. This may sound like a confusing contradiction, but Excel allows you to actually format the comment, independent of the text contained in the comment, so that it is "filled" with a picture.
Note that Microsoft changed the way comments work in Excel in Office 365. Comments are now threaded allowing users to have discussions with each other regarding the data. Notes work like comments in earlier versions of Excel. The following steps apply both to earlier versions of Excel using comments and to Excel for Office 365 using notes:
Figure 1. The Colors and Lines tab of the Format Comment dialog box.
Figure 2. The Picture tab of the Fill Effects dialog box.
Remember that these steps don't actually insert a picture in the comment or note, but instead use the picture as the fill color for the comment or note. This means that you can still add any text in the comment or note you want and it will overlay the picture you just inserted. You can, if desired, also delete any text in the comment or note so that it appears the only thing in the comment or note is the picture.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13280) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365.
Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!
If you want an image to appear more than once in a worksheet, there are a few ways you can approach the issue. This tip ...
Discover MoreIf you want to create a line in your worksheet that is a specific length and slope, there are a couple of ways you can do ...
Discover MoreIf you use Excel to keep a graphic with each row of data you amass, you may wonder if there is a way to easily delete the ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2023-04-20 14:11:56
J. Woolley
@John Robinson
The Tip's procedure still works for me (Excel 365 Version 2303).
My Excel Toolbox includes the PasteImageInComment macro to paste an image from the clipboard or from a file as background in a cell's Unthreaded Comment (Note).
As described in earlier discussion below, My Excel Toolbox also includes the following function to add a background image to an Unthreaded Comment:
=ImageInComment(ImageFile,[Target],[ScaleFactor],[RotateAngle],[NoAuthor])
See https://sites.google.com/view/MyExcelToolbox/
2023-04-19 09:17:47
John Robinson
This stopped working two days ago. Do you have a work around for this? When you get to Select Picture the three options you get From a file, Bing Image Search, and OneDrive now do nothing. This appears to have stopped working this week.
2021-12-29 15:59:28
J. Woolley
For more discussion of this subject, see:
https://excelribbon.tips.net/T005489_Pasting_Pictures_into_a_Comment.html
https://www.thespreadsheetguru.com/the-code-vault/vba-insert-image-into-cell-comment
https://sites.google.com/view/myexceltoolbox/Comment
2021-11-16 08:13:58
PLB
It doesn't work. There is no context menu with "format comment" listed on it.
Maybe Excel change his soft recently. Have you heard something about that?
I'm on Mac with Excel 16.53
2021-09-18 06:01:52
Kurt Müller
@J. Woolley: part 3 (edited)
I use the latest version with .Height = IIf(ScaleFactor > 100, ScaleFactor, .Height * ScaleFactor)
Test with Erdbeere.jpg: https://imagizer.imageshack.com/img923/7374/SLK2XR.jpg
(see Figure 1 below) picture replaced with correct one
(see Figure 2 below)
(see Figure 3 below)
Figure 1. Comment before pasting picture Erdbeere (3): 5,69 cm x 6,99 cm
Figure 2. Comment after pasting picture Erdbeere (3): 91,44 cm x 68,58 cm
Figure 3. =ImageInComment("D:TestExcel-Forum-BilderErdbeere-10.jpg";A8;1)
2021-09-18 04:50:14
Kurt Müller
@J. Woolley: part 3
I use the latest version with .Height = IIf(ScaleFactor > 100, ScaleFactor, .Height * ScaleFactor)
Test with Erdbeere.jpg: https://imagizer.imageshack.com/img923/7374/SLK2XR.jpg
(see Figure 1 below)
(see Figure 2 below)
(see Figure 3 below)
Figure 1. Comment before pasting picture Erdbeere (3): 5,69 cm x 6,99 cm
Figure 2. Comment after pasting picture Erdbeere (3): 91,44 cm x 68,58 cm
Figure 3. =ImageInComment("D:TestExcel -Forum -BilderErdbeere-10.jpg";A8;1)
2021-09-18 04:32:54
Kurt Müller
@J. Woolley: part 2
I use the latest version with .Height = IIf(ScaleFactor > 100, ScaleFactor, .Height * ScaleFactor)
Test with Erdbeere.jpg: https://imagizer.imageshack.com/img923/7374/SLK2XR.jpg
(see Figure 1 below)
(see Figure 2 below)
With ScaleFactor = 1,0 this picture already gets too large:
=ImageInComment("D:/Test/Excel/0-Bilder/Erdbeere-10.jpg";H7;1,0)
The size of the comment (before pasting the image) is: width/heigth = 5,69 cm/6,99 cm.
My image Erdbeere-10.jpg (Erdbeere (german) = strawberry) has the following size: 2592 x 1944 Pixels.
The size of the comment (after pasting the image) is too large: width/heigth = 91,44 cm/68,58 cm.
The image aspect ratio:
height/width = 1944/2592
height/width = 0,75
In my opinion should
- the comment aspect ratio follow the image aspect ratio but
- the image size follow the comment size. The comment size would be in this case: 6,99 cm * 0,75 = 5,25 cm
With ScaleFactor > 1 the picture is not getting smaller but even larger.
Please look at this.
Erdbeere.jpg: https://imagizer.imageshack.com/img923/7374/SLK2XR.jpg
Figure 1. Comment after pasting picture Erdbeere (1)
Figure 2. Comment after pasting picture Erdbeere (2)
2021-09-18 04:28:42
Kurt Müller
@J. Woolley: part 1
I use the latest version with .Height = IIf(ScaleFactor > 100, ScaleFactor, .Height * ScaleFactor)
Test with Erdbeere.jpg: https://imagizer.imageshack.com/img923/7374/SLK2XR.jpg
(see Figure 1 below)
(see Figure 2 below)
(see Figure 3 below)
Figure 1. .Height = IIf(ScaleFactor > 100, ScaleFactor, .Height * ScaleFactor)
Figure 2. Comment before pasting picture Erdbeere (1)
Figure 3. Comment before pasting picture Erdbeere (2)
2021-09-12 09:50:52
J. Woolley
@Kurt Müller
I don't think you have the latest version of My Excel Toolbox's ImageInComment which includes the following statement:
.Height = IIf(ScaleFactor > 100, ScaleFactor, .Height * ScaleFactor)
If you want to continue this discussion, I suggest we use
https://sites.google.com/view/MyExcelToolbox/Comment
2021-09-11 08:21:27
Kurt Müller
@ J. Woolley
Thank you very much.
If I put this formula in a worksheet cell, I do not know how to choose the appropriate ScaleFactor in advance, since I do not know the size of the picture after it is pasted. The user needs to make calculations in advance or repeat the process several times.
With ScaleFactor = 1,0 this picture already gets too large:
=ImageInComment("D:/Test/Excel/0-Bilder/Erdbeere-10.jpg";H7;1,0)
The size of the comment (before pasting the image) is: width/heigth = 5,69 cm/6,99 cm.
My image Erdbeere-10.jpg (Erdbeere (german) = strawberry) has the following size: 2592 x 1944 Pixels.
The size of the comment (after pasting the image) is too large: width/heigth = 91,44 cm/68,58 cm.
The image aspect ratio:
height/width = 1944/2592
height/width = 0,75
In my opinion should
- the comment aspect ratio follow the image aspect ratio but
- the image size follow the comment size. The comment size would be in this case: 6,99 cm * 0,75 = 5,25 cm
With ScaleFactor > 1 the picture is not getting smaller but even larger.
Please look at this.
Erdbeere.jpg: https://imagizer.imageshack.com/img923/7374/SLK2XR.jpg
2021-09-06 10:23:44
J. Woolley
@Kurt Müller
The latest version of My Excel Toolbox's ImageInComment allows ScaleFactor to be like 0.75 for 75% scale, but if ScaleFactor > 100, then the image's scaled height will be ScaleFactor points (72 points/inch). The comment's width will adjust to match the image's aspect ratio, avoiding distortion.
See https://sites.google.com/view/MyExcelToolbox/
As described in my earlier comments, ImageInComment is a Function, not a Sub, so it can be used in a cell formula. If you want to use a Function in VBA instead of a cell formula and ignore the returned result, your example with a Call statement will work. The Application.Evaluate shortcut [H7] is OK, but Range("H7") would be better. Here are two other ways to use the Function in VBA:
ImageInComment "D:/Test/Excel/0-Bilder/Erdbeere-10.jpg", Range("H7")
result = ImageInComment("D:/Test/Excel/0-Bilder/Erdbeere-10.jpg", Range("H7"))
Or you could put this formula in a worksheet cell:
=ImageInComment("D:/Test/Excel/0-Bilder/Erdbeere-10.jpg",H7)
2021-09-05 14:44:39
Kurt Müller
@ J. Woolley
I appreciate your work. Thank you very much.
I entered the following macro in a modul by myself:
Sub ImageInComment()
Call ImageInComment("D:/Test/Excel/0-Bilder/Erdbeere-10.jpg", [H7])
End Sub
The size of the comment (before pasting the image) is: width/heigth = 5,69 cm/6,99 cm.
My image Erdbeere-10.jpg (Erdbeere (german) = strawberry) has the following size: 2592 x 1944 Pixels.
The size of the comment (after pasting the image) is too large: width/heigth = 91,44 cm/68,58 cm.
The image aspect ratio:
height/width = 1944/2592
height/width = 0,75
In my opinion should
- the comment aspect ratio follow the image aspect ratio but
- the image size follow the comment size. The comment size would be in this case: 6,99 cm * 0,75 = 5,25 cm
2021-09-01 12:07:57
J. Woolley
My Excel Toolbox has yet another update of the ImageInComment function described in my earlier comments. Here is the new syntax:
=ImageInComment(ImageFile,[Target],[ScaleFactor],[RotateAngle],[NoAuthor])
If RotateAngle is 90, 180, or 270, it specifies degrees of clockwise image rotation; any other value is ignored. The default value is 0. Notice this new parameter was inserted before NoAuthor, which remains the last parameter.
My Excel Toolbox also includes the new ListImageProperties(ImageFile) function, which returns an array of image properties for ImageFile's ActiveFrame; expect 2 columns and 18 rows. This function is most useful as a dynamic array in newer versions of Excel. You can also use it like this in older versions of Excel that do not support dynamic arrays:
=SpillArray(ListImageProperties(ImageFile))
SpillArray will determine and populate the spill range for its array expression argument, simulating a dynamic array.
See https://sites.google.com/view/MyExcelToolbox/
2021-08-29 18:17:31
ShaneS
Great! Many thanks for your help.
2021-08-29 15:31:58
J. Woolley
My Excel Toolbox now includes an improved version of the ImageInComment function described in my earlier comment. Here is its syntax:
=ImageInComment(ImageFile,[Target],[ScaleFactor],[NoAuthor])
This will apply the image from ImageFile as Fill Effect in Target's unthreaded Comment (a.k.a. Note). The image's size is adjusted by ScaleFactor, which defaults to 1. If a new comment is necessary and NoAuthor is TRUE, the new comment will have blank text; NoAuthor's default is FALSE. The text of existing comments is never altered.
See https://sites.google.com/view/MyExcelToolbox/
2021-08-27 14:37:14
J. Woolley
@Kurt Muller
Please review my recent comment. Test the ImageInComment function. I believe it resolves the issues you raised.
2021-08-27 13:14:42
Kurt Müller
Attention
If the comment does not have the same aspect ratio as the picture, then the picture is distorted.
If Lock picture aspect ratio is checked, only a cut of the non distorted picture can be seen.
Lock picture aspect ratio is not available with VBA.
2021-08-26 18:04:24
J. Woolley
@ShaneS
The following function will add an image to a comment. Here is its syntax:
=ImageInComment(FilePath,[Target])
where FilePath describes the image file and optional Target is the cell to receive the comment. If Target is omitted, the default is the cell with the formula.
Examples:
This formula in cell A1 will put the image from MyImage.jpg in A1's comment:
=ImageInComment("C:/Users/MyName/Documents/MyImage.jpg")
If cell A2 contains C:/Users/MyName/Documents/MyImage.jpg as text, then this formula in cell A1 will put the image from MyImage.jpg in A1's comment:
=ImageInComment(A2)
and this formula in cell A1 will put the image from MyImage.jpg in A3's comment:
=ImageInComment(A2,A3)
Here is the function's VBA:
Function ImageInComment(FilePath As String, _
Optional Target As Range = Nothing)
Dim Cell As Range, Addr As String
Dim WIA As Object, bFail As Boolean
Const PtPerPx As Single = 72 / 96
If Target Is Nothing Then
Set Cell = Application.Caller
Else
Set Cell = Target.Cells(1)
End If
Set WIA = CreateObject("WIA.ImageFile")
bFail = (FilePath = "" Or Dir(FilePath) = "")
If Not bFail Then bFail = WIA.LoadFile(FilePath)
With Cell
Addr = .Address(False, False)
If .Comment Is Nothing Then .AddComment
With .Comment.Shape
If bFail Then
.Fill.Solid
ImageInComment = "Invalid image FilePath"
Else
.LockAspectRatio = False
.Height = WIA.Height * PtPerPx
.Width = WIA.Width * PtPerPx
.LockAspectRatio = True
.Fill.UserPicture FilePath
ImageInComment = "See comment @ " & Addr
End If
End With
End With
Set WIA = Nothing
End Function
2021-08-23 23:10:43
ShaneS
Heres a tricky question. Can you somehow cause the picture in the comment to update depending on the content of another cell?
I have a situation where I have a drop-down box, and I would like to add a comment that users can hover over, that shows a picture of whatever they have selected int eh drop-down list.
I don't have the luxury of having a clear cell next to the list which could have the picture displayed, and could change to suit.
I found a VBA code which updates a comment, dependant on another cell, which is half the way there, but it doesn't update a picture.
Can anyone help here?
2021-01-22 15:39:52
Margaret Messick
Hello. Thanks for this tip. But I want to take this further - I have a spreadsheet with the photos in the comments and want to publish it to a website. I can open the file in my browser (from the file stored on OneDrive) and open the note but the picture doesn't show. Is there any way to make the photo show in the note when it is on the web???
Thanks,
Margaret
2020-07-19 21:23:58
Louie E
wow i have to do this process for like 3000 times! though i was looking for a way that you can insert multiple pictures in a comment...
2020-07-13 12:43:54
Where do you see the context menu?
2019-06-13 06:46:40
Ron West
I failed to mention that this is in the Excel 2019 Version for Mac
Ron
2019-06-12 18:56:15
Ron West
Hi,
It appears that Microsoft have removed the ability to insert a picture/image in the way above. It may have something to do with copyright/creative commons/licensing, cheers.
Ron
2019-03-31 06:13:38
Chanchea
hi,
when i click to insert a picture into comment, it request me to update inter explorer, i try to update but nothing happen
2014-10-22 13:16:04
Leticia Marquez
Thank you for the tip.
2014-10-20 13:08:12
Kim Carlton
Very cool. Thanks for this one.
2014-10-20 12:28:59
Brooke
I've found a problem with this method. After saving the file and subsequently opening and closing it a few times, I will get an error stating that there is some problem with the file and that the offending data has been "scrubbed." The next time the file is opened, the pictures that were in the comments are now gone. Haven't been able to figure out how to stop this from happening as it is very irritating after taking the time to add multiple photos to comments in a large file. Apparently this is a known issue as I have found some discussion of the problem in online Excel forums.
2014-10-20 09:08:16
Nice!
Now if MS would only make this in-line with how it's done in Word.
First, if you add text to the Comment it sits on top of the picture.
Second, I don't see a way to simplify this process, i.e. create a macro that would eliminate all of the navigation through the dialogues. Recording a macro showed no hint and the object model seems to hide how this is structured.
I'm afraid that trying to teach some of my users how to do this would make their eyes roll all the way back in their heads.
2014-10-18 11:58:05
COOL !!
2014-10-18 09:41:14
Sharon Hammond
Loved this tip. Just goes to show you can never know enough about Excel :)
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments