Excel can I link to a picture in another sheet, same worksheet?

jkanderson

New Member
Joined
Oct 4, 2020
Messages
8
Office Version
  1. 2013
Platform
  1. Windows
I know I can put pictures in an Excel comment.
Sometimes I want to use the same picture on several different sheets in the same workbook.
I want the picture to popup on hover over like a picture in a comment does.
Is there any way for the comment to link to (and show) the picture by hyperlink?
I want to keep filesize down and rather than insert the same picture 3 and 4 times on different sheets I am hoping a comment can link to the (one) original picture on the sheet
If this can be done how can I do it?
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Welcome to MrExcel


I cannot think of a way to do exactly what you want
- but there may be a way to achieve something very similar by using VBA

Q1 Is VBA acceptable?
Q2 How many pictures are required to popup in different sheets?
Q3 Do source comment and destination comment contain the same text?
 
Upvote 0
What I am doing is a genealogy spreadsheet. Not the traditional ancestry chart, but just a list of names with picture in a comment that pops up when their name is hover-over. Then the comment with the picture goes back down with a mouse-out. So that would be a lot of pictures. A separate sheet in the workbook will be exclusively for the pictures, and these will be ones for the comments in the list of names sheet to link to.

A1 - sure VBA is welcome. But I will need baby steps. Sometimes you got to point me.
A2 - a couple hundred people on the one list of names sheet with the picture sheet having a picture for each person.

A3 - there isn't any text in either the comment or the destination picture. The name sheet has 3 or 4 columns with each row having one column for name (and the linked picture of that person will popup on a hover-over). Another column same row can have popup hover-over pictures of the parents. Another column same row, a popup hover-over picture of the kids. Pictures can be joined into one photo for the parents column and also for the kids column so there is only one picture linking from any comment.

Also one thing I have been searching for is to make the comments on the name sheet to always open in the center of the screen. If they don't then the names at the lower area of the screen will pop up but at the bottom and I have to scroll to see the entire picture. Then I have to scroll back up to continue from where I was after the picture in the comment goes back down.
 
Upvote 0
Proposed solution
Use VBA to simply COPY the comment picture from Picture Sheet to Destination Sheet when required and delete it when not required
- need to determine which triggers can be used to make that process automatic whilst requiring minimal (if any) user involvement

When I underestand how everything should behave we can carry out some quick preliminary testing to see if you think my solution will give you what you want
- we will develop the solution together step by step and everything will be fully explained

Sheet containing list of names
1. What is its name?
2. Approximately how many names do you expect it contain in due course?
3. Is the text in each cell which contains a lead name IDENTICAL to text in destination cell in other sheets?
4. How are duplicate names differentiated?
(The above will help me work out how to get VBA to determine the correct cell when copying a picture)
 
Upvote 0
Also one thing I have been searching for is to make the comments on the name sheet to always open in the center of the screen. If they don't then the names at the lower area of the screen will pop up but at the bottom and I have to scroll to see the entire picture. Then I have to scroll back up to continue from where I was after the picture in the comment goes back down.

If you read the link below, it will help you understand why the immediate answer is (again) that there may be a way to achieve something very similar by using VBA

I will give it some thought over the next day or so
 
Upvote 0
Also, for positioning comments on the screen so they are never offscreen, you may be interested in this thread :
 
Upvote 0
Thanks I'll check out the links. Can I send you a simple 10 row or so example of what I am trying to do? Perhaps an example of members of Britain's Royal Family? That would make things a little easier to follow.

My entire concept of this is to keep file size down, and also to keep the pictures handy to popup. The picture sheet wouldn't have any single picture over 100k, most are probably 35k. But still, with a hundred or more pictures entered and all of them linked like how I would want I am concerned the Excel file could get corrupted if too large. I back up but something like this I want to take every precaution.

I think the concept of what I am trying to do is something others would find useful for any type of project involving popup comments on demand that would use a photo more than once.

Thanks for your help!
 
Upvote 0
Regarding post 6: Code like this is what I have been trying to understand. Maybe if you take this step by step, all of us could learn it.
Thanks again
 
Upvote 0
Also one thing I have been searching for is to make the comments on the name sheet to always open in the center of the screen. If they don't then the names at the lower area of the screen will pop up but at the bottom and I have to scroll to see the entire picture. Then I have to scroll back up to continue from where I was after the picture in the comment goes back down.

Try this simple workaround ....
(if you prefer it to work slightly differently let me know)

How it works
When comment is displayed in an awkward spot ... user right-clicks on cell to move the comment


To test
Using a COPY of your workbook ...
- install the code
- activate name sheet
- right-click on any cell containing a comment
- double click on same cell to hide its comment

The code
The code must be placed in the sheet module of the name sheet
- right-click on sheet name tab \ select View Code \ paste code into that window
VBA Code:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
    On Error Resume Next
    With Target
        If Not .Comment Is Nothing Then
            Cancel = True
            Application.ScreenUpdating = False
            With .Comment
                .Visible = True
                .Shape.Top = ActiveWindow.VisibleRange.Top + 10
                .Shape.Left = Target.Offset(, 2).Left
            End With
        End If
    End With
    On Error GoTo 0
End Sub

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    On Error Resume Next
    Cancel = True
    Target.Comment.Visible = False
    On Error GoTo 0
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,535
Messages
6,114,194
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top