 | Instead of using the Hyperlink command button on the Insert tab of the Ribbon, you can use Excel 2007's HYPERLINK function to create a hypertext link. (You can't use this function to attach a hyperlink to a graphic object.) The HYPERLINK function uses the following syntax: |
HYPERLINK(link_location,[friendly_name])
The link_location argument specifies the name of the document to open on your local hard disk, on a network server (designated by a UNC address), or on the company's intranet or the World Wide Web (designated by the URL address). The optional friendly_name argument is the hyperlink text that appears in the cell where you enter the HYPERLINK function. If you omit this argument, Excel displays the link_location argument as the text in the cell.
When specifying the arguments for a HYPERLINK function that you type on the Formula bar (as opposed to one that you create by using the Insert Function feature by filling in the text boxes in the Function Arguments dialog box), you must remember to enclose both the link_location and friendly_name arguments in closed double quotes. For example, to enter a HYPERLINK function in a cell that takes you to the home page of the For Dummies Web site and displays the text "Dummies Home Page" in the cell, enter the following in the cell:
=HYPERLINK("http://www.dummies.com","Dummies Home Page")
This might seem like a roundabout way to do something that Hyperlink command button can do in a flash. But the HYPERLINK function's power is apparent when you combine it with other Excel functions.
For example, when most people record Web site URLs, they leave off the common protocol marker http://. But Excel won't connect to the site if it doesn't have the full URL. You can work around this with a simple formula.
 | Say you have the truncated URL www.dummies.com in cell A1, and you have the text that you want to appear as a link in cell B1. You can combine these two into a link with the following formula: |
=HYPERLINK("http://" & A1, B1)
But maybe you don't know whether the URL in cell A1 has the http:// at the beginning or not! You can combine a few Excel functions to test how the URL begins and then create the hyperlink with this formula:
=IF(LEFT(A1, 4)="http", HYPERLINK(A1, B1),HYPERLINK("http://" & A1, B1))
You can also use the HYPERLINK function to link to files on your computer or on a company intranet by following this format:
=HYPERLINK("\\server\share\path\filename", [friendly_name])
|