# hot to assign an image to another tab's cell with 'double click'

#### Terry89

##### New Member
Dear All,

I have an image database in excel (2010). I want to assign every image with a specific cell of another tab of the same excel file. I want to do this with 'double left click'. Could you please help me?

I did it in the first place by placing a hyperlink to every image but because it only supports a 'single left click' you can accidentally go to another tab and it is frustrating.

Thanks!

### Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hello and welcome to the Board

- Double clicking an image will not fire an event, but here is a workaround:
- Paste the two macros where indicated
- Create a table similar to the one shown below; if you can’t use that particular range, the formulas will need adjusting
- Run the table macro, which will populate some fields
- Fill manually the destination field
- Click a cell near an image and you will be taken to the corresponding sheet. The picture’s top left cell is used as position reference.

Invoice (3)

 * A B C D E F G 2 Image # Image Name Image Col Destination Last used row Target Col Col chosen 3 1 hli2 13 Plan1!F9 5 10 13 4 2 Picture 3 6 Dest!k4 * * * 5 3 hli1 17 Instructions!P7 * * *

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:64px;"><col style="width:92px;"><col style="width:74px;"><col style="width:108px;"><col style="width:101px;"><col style="width:69px;"><col style="width:76px;"></colgroup><tbody>
</tbody>

 Cell Formula E3 =MATCH(LOOKUP(2,1/(A:A<>""),A:A),A:A) G3 {=INDEX(C3:C5,MATCH(SMALL(ABS(F3-C3:C5),1),ABS(F3-C3:C5),0))}

<tbody>
</tbody>
Formula Array:
Produce enclosing
{ } by entering
formula with CTRL+SHIFT+ENTER!

<tbody>
</tbody>

Excel tables to the web >> Excel Jeanie HTML 4

Code:
``````' standard module
Sub GenerateTable()
Dim r%, i%
Range("a3:c100").ClearContents
For i = 1 To ActiveSheet.Pictures.Count
Cells(i + 2, 1) = i
Cells(i + 2, 2) = ActiveSheet.Pictures(i).Name
Cells(i + 2, 3) = ActiveSheet.Pictures(i).TopLeftCell.Column
Next
r = ActiveSheet.Range("e3")
ActiveSheet.Range("g3").FormulaArray = "=index(c3:c" & r & ",match(small(abs(f3-c3:c" _
& r & "),1),abs(f3-c3:c" & r & "),0))"
End Sub``````

Code:
``````' sheet module
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim sr
Me.Range("f3") = Target.Column
sr = Split(Me.Range("d" & Evaluate("=match(g3,c:c,0)")), "!")
Sheets(sr(0)).Activate
Sheets(sr(0)).Range(sr(1)).Activate
End Sub``````

Replies
1
Views
273
Replies
0
Views
319
Replies
1
Views
523
Replies
4
Views
551
Replies
9
Views
371

1,218,899
Messages
6,145,094
Members
450,590
Latest member
Naneng

### 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.

### Which adblocker are you using?

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

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