![]() |
|
|
|
#1
|
|||
|
|||
|
Hi:
I am searching one solution for a mouseover. If I put the mouse in A1 open the image of the path that it is in B1, the same for A2 and B2,.....I need a solution with ranges. When I move the mouse from the cell, the image close automatically. I don“t want to use the pictures in the comments. Could you help me? Thanks in advance |
|
#2
|
|||
|
|||
There are many ways. One of them is to insert the image in a comment:The comment box with your image will appear on mouseover. Cheers, |
|
#3
|
|||
|
|||
|
Thank for the answer, but I prefer other solution without inserting the picture in a comment box.
I have automatice the insertion of the path in the column, and I prefer to use VB. What are other solutions? |
|
#4
|
|||
|
|||
|
Hi Igorr,
Is there a reason behind this prefference? You can use a code to load images in comments, and after this is done, you will not depend on macros to view the images, it will work even without macros enabled... You can try the file attached for another possibility. I used the LoadImagePath procedure to insert the images from a folder named Images, located in the same folder where this workbook is saved. (the images are already inserted, no need to run the code again, only if you want to change the images) Code:
Sub LoadImagePath()
Dim Types As String, Nm As String
Types = "JPEG Image, PNG Image" 'add more types if needed
Dim Dest As Worksheet, i As Integer, oFso As Object, Img As Object
Set Dest = Worksheets("Mouse Over")
Set oFso = CreateObject("Scripting.FileSystemObject")
i = 2
For Each Img In oFso.getfolder(ThisWorkbook.Path & "\Images").Files
If InStr(Types, Img.Type) > 0 Then
Dest.Cells(i, "A") = Img.Path
Rows(i).RowHeight = 75
Nm = Mid(Dest.Cells(i, "A").Text, InStrRev(Dest.Cells(i, "A").Text, "\") + 1, InStr(Dest.Cells(i, "A").Text, ".") - InStrRev(Dest.Cells(i, "A").Text, "\") - 1)
DoEvents
Application.Goto Dest.Cells(i, "B")
Dest.Pictures.Insert(Dest.Cells(i, "A").Text).Select
Selection.Height = 75
Selection.Name = Nm
' Dest.Cells(i, "E") = Img.Type
i = i + 1
End If
Next
End Sub
Code:
Function ShowHideImage(Rw As Integer, ViewOption As Boolean)
Dim Nm As String
Dim Dest As Worksheet
Set Dest = Worksheets("Mouse Over")
Nm = Mid(Dest.Cells(Rw, "A").Text, InStrRev(Dest.Cells(Rw, "A").Text, "\") + 1, InStr(Dest.Cells(Rw, "A").Text, ".") - InStrRev(Dest.Cells(Rw, "A").Text, "\") - 1)
If ViewOption Then
Dest.Shapes(Nm).Height = 75
Else
Dest.Shapes(Nm).Height = 0
End If
End Function
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Setting up signature image and image is received blurry
|
Beesoy06 | Outlook | 2 | 03-23-2015 09:01 PM |
| Losing image resolution when inserting image into MS word (2011: Mac) | Mario.N | Drawing and Graphics | 0 | 11-23-2014 02:38 AM |
| Mouseover cell to indicate mouse pointer location based on Specific Row/Column values | bolandk | Excel | 1 | 05-15-2014 08:22 AM |
Highlight text when mouseover
|
kxt | Word | 4 | 05-17-2012 04:21 PM |
| Mouseover Highlite | designer | PowerPoint | 0 | 01-19-2011 07:28 AM |