Macro to open pdf file

T

Trev

How can I click on an Excel(2010) cell so that a pdf file opens. I
have a column of numeric values in Excel and I want each cell to link
to a pdf invoice in My Documents. So the cell with value 12345 in
Excel would automatically link to 12345.pdf in My Documents. I know I
can right click and set up a hyperlink to the file but there must be a
"one button" solution.

thanks,
 
D

Dave Peterson

Could you use an adjacent cell and a formula that creates the hyperlink?

Like:

=hyperlink("File:////c:/my documents/" & a1 & ".pdf", "Click Me")
 
T

Trev

Could you use an adjacent cell and a formula that creates the hyperlink?

Like:

=hyperlink("File:////c:/my documents/" & a1 & ".pdf", "Click Me")
Thank you; that works perfectly. But it would be nice if I could click
directly on the number without having an extra column.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top