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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Drill Through" in Excel

Status
Not open for further replies.

Scott24x7

Programmer
Jul 12, 2001
2,827
JP
All,
I have an idea for an Excel file I want to create, but there is one thing that is causing me trouble. I would like to be able to double click on a cell, and have that cell either link to a document, or pass the contents to a cell to another function that presents a document.
To help with the context of the content, let's assume for a moment I have a file that is a "phone directory". It has first name, last name, mobile phone, work phone, home phone.

I would like to, if I double click (must be double-click) on the cell, have it open a photo of the person (can store the file name in another hidden cell in the same row is fine), and display it using say, Windows default Image and Fax viewer.

What is the best way to go about something like this? My preference is to do without the use of a macro, but macro function is not out of the question.

Thanks,
Scott

Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Put some event code into the worksheet module ( right click the tab, and choose View Code from the context menu ), like this:
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Cells(Target.Row, 6).Value <> "" Then
        ActiveWorkbook.FollowHyperlink (Cells(Target.Row, 6).Value)
        Cancel = True
    End If
End Sub
This is assuming that the filenames are in column F ( the 6th column ... which is why the Cells(...,6) is being used ).

Cheers, Glenn.

Beauty is in the eye of the beerholder.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top