Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Image Question

Status
Not open for further replies.

Scott24x7

Programmer
Jul 12, 2001
2,814
JP
Hi All,
Is it possible to have a image popup when you hover over a cell. The images should be stored on a hidden page in the same workbook (images on a page, and hiding it I can do). But I wanted something like a VLOOKUP to find the image based on a cell in the row and then present the image in like a "Tool Tip Help" style.
Is there a way to do this?


Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"I try to be nice, but sometimes my mouth doesn't cooperate.
 
Erm ... used to be a trick using a Comment and putting a picture in the comment - but not sure you can get the image from the sheet for that.
 
As strongm wrote, you can have an image in comment (just fill it with image and clear text) with hover effect. The image is static.
Using camera tool you can have dynamic images from hidden (or even very hidden) sheet - just use dynamic names as reference for the image. In fact it is a snippet of the sheet. There is no hover effect in this case.

combo
 
Ok, let me try that and see if it will give me what I need.
Cheers guys.


Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"I try to be nice, but sometimes my mouth doesn't cooperate.
 
You can open new world using VBA. In the attached workbook I put an old code that uses API timer to generate time ticks. According to the cell address and contents an image is filled by named range image. You need to run GoTimer[tt][/tt] to start tracing the cursor and [tt]DeactivateMyTimer[/tt] to stop or before closing the workbook.
Some warnings:
- the code uses API, be careful with it, save your work before testing,
- I don't know how it will behave in office 64 bit environment (works in win 10 64 bit and office 2016 32 bit),
- create and destroy timer procedures you can put in workbook's open and close procedures, esp. the second one has to be excecuted to avoid problems.

The code uses camera tool (image in fact with reference to range). As an alternative to hoover effect you can create a data validation dropdown and use its selection to change refernced address, no code required for this.

combo
 
 https://files.engineering.com/getfile.aspx?folder=a6ce442f-2d9b-42ac-92db-fcadad748668&file=Franklin-Washington_Identification_Matrix_v017_WithSlicers.xlsm
That's really interesting, combo. Interesting, indeed.

I'd definitely caution the API use. What I'd be afraid of happening is something in the workbook break, and it crash without killing off the timer event. Would that cause problems afterwards? Maybe memory leakage if happens regularly?

Maybe I'll look at that file later out of curiosity... hopefully.

"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
 
I don't know, I use API rarely and only if really necessary. 64-bit environments (windows, VBA) may require changes in code.
After posting the workbook I realised that the hover effect can be improved by moving the image relatively to cell from callback and hide it if the cell is outside traced range.

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top