How to display a picture when you set the mouse over in Excel

Source: Internet
Author: User

To realize the interactive effect of the related picture of the mouse pointing to the cell in the Excel table, you can easily do it by adding a picture annotation feature to the Excel2007.

Below, we take the product list as an example to show the specific method of adding pictures.

mouse pointer to cell, automatically show preset picture

Single Add picture

Right-click the target cell, select Add annotation, delete all text in the annotation entry box, then move the mouse to the edge of the annotation input box, and when the pointer becomes a cross arrow, right-click to select "Format annotation" → "Color and line" → "fill effect" → "picture", and then click "Select Picture" to add a picture.

Now the mouse pointer to the target cell to display the picture, remove the mouse picture will be automatically hidden. If the picture does not automatically disappear when the mouse is moved, you can click Office in the upper-left corner of the Excel window, click Excel Options in the menu that pops up, select advanced on the left side of the Excel Options window, select Show only markers on the right, and highlight annotations on hover. The picture can be automatically hidden after the confirmation.

Bulk Add pictures

If you have many cells to add a picture annotation, setting it up is cumbersome. We can set up picture annotations by macro batch.

First of all need to use the picture file into a folder (for example: F: Product map), each picture name must be the corresponding product name in the table, with "product name. jpg" such as the format named, such as Ang Vx545hd.jpg, Ang vx757.jpg and so on. In addition, all pictures should be in the same height ratio to ensure that the pictures displayed after the uniform settings are not distorted.

Then, open the workbook in Excel2007, press the key combination "Alt+f8" to open the Macro window, enter the macro name "Add Picture annotation", click the "Create" button, and edit the code in the Open VBA window.

Code fragment:

Sub Add picture annotation ()

Dim cell

On Error Resume Next

For each cell in Selection

Cell. AddComment

Cell. Comment.Shape.Fill.UserPicture "F: Product Diagram" & cell. Value & ". jpg"

Cell. Comment.Shape.Height = 120

Cell. Comment.Shape.Width = 200

Next cell

End Sub

Finally, close the VBA window and save the file as a document in the Excel macro-enabled Workbook format. Now you just select all the cells you want to set, such as A4:A20, press the key combination "Alt+f8" to open the Macro window, double-click "Add Picture Annotation" in the list to run the macro, you can add a picture of the cell in batches.

(Note: The picture is saved directly in the workbook after it is set up). If the product name in the table has changed, or the picture file used for the annotation has been replaced, you can just run the "Add Picture annotation" macro to refresh.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.