Monday, November 26, 2018

Excel And Hyperlinks.


What is a Hyperlink?


A hyperlink is an object that links to another location in the same file, or to another file altogether. Word processing documents, workbooks, and web pages are all types of files that can contain hyperlinks. When you click on a hyperlink, the associated file or location will open.

The files connected by hyperlinks do not have to be in the same directory, or even on the same computer. In fact, you can have a hyperlink in one file that links to a file thousands of miles away. The World Wide Web makes extensive use of hyperlinks to link web pages together. This is, in fact, where most computer users first become familiar with hyperlinks.

Quite often, hyperlinks come in the form of an underlined word or phrase in a bright blue font. This does not have to be the case, though, as hyperlinks can be a word, a phrase, a symbol, or even a picture! When you click on a hyperlink, an associated URL is used to locate and retrieve the object or file that the hyperlink points to. In the case of the World Wide Web, hyperlinks are used to link and unify web pages that are located on different servers all over the world.

You can create a hyperlink in an Excel workbook that links to an object located in the same directory or on the same computer as the workbook. You can also create a hyperlink that points to a web page, to a file on a remote server, to a location in the same workbook, or to a specific e-mail recipient.


Inserting Hyperlinks


There are times when you might want to insert a link in your Excel worksheet that takes you to another location in the same workbook, or perhaps to another Excel workbook located on the same computer. You might also want to insert a link to a Word document or to a web page that contains helpful information. Fortunately, in Excel 2013 it is fairly easy to insert hyperlinks into your worksheets.

  • To start, right-click on the cell that will contain the link, and then click Hyperlink:
    insert hyperlinks to worksheet
  • Another way to display the dialog is to first select the cell that will contain your hyperlink, and then choose Insert → Hyperlink: 
    insert hyperlinks in excel
  • Either action will open the Insert Hyperlink dialog:
    dialog box inserting hyperlink in excel
  • Take note of the four buttons running down the left side of the dialog box under the “Link to:” heading. You can use these buttons to create a link to an “Existing File or Web Page,” a “Place in This Document,” “Create New Document,” or to an “E-mail Address.”
  • At the top of the dialog, you can see a box named “Text to Display.” The text entered here will appear as a blue underlined hyperlink in the cell that you originally selected. This is what the user will see and click on.
  • If you choose the Existing File or Web Page button, you will see a drop list labeled “Look in” just below the “Text to display” field. You can use this list to browse through the various folders on your computer to find the file that you want to create a link to.
  • When you select a folder or drive from the drop list, a list of available files or folders corresponding to the selection will appear in the large center area of the dialog box.
  • You will also notice three buttons just to the left of the navigation area: Current Folder, Browsed Pages, and Recent Files
    select a folder or drive from the drop list in excel_2
  • If you click Current Folder, the drives, files, or subfolders of the current item displayed in the drop list will be displayed. In the preceding image, you can see that “Computer” is entered in the drop box, and the drives on “Computer” are displayed. You can use these navigation tools to navigate and select pretty much any file on your system.
  • If you click the “Browsed Pages” button, a list of web pages that you recently visited will be displayed, like this:
    browsed pages in hyperlink excel
  • If you click an item in the list to select it, information for the selected item (a URL) will be entered in the “Address” field and in the “Text to display” field (the text that forms the actual hyperlink).
  • If you click on the Recent Files button, you will see a list of recently accessed files.
    location links to hyperlinks if click recent files in excel
  • If you make a selection from an item on one of these lists, the location information (URL or directory path) for the item will be entered in the Address field at the bottom of the dialog box (much like the preceding example for “Browsed Pages”).
  • You can also click the ScreenTip button in the upper right of the dialog box to add a brief comment that will appear when the mouse pointer hovers over the hyperlink.
  • You can also take the old fashioned route and type a URL for a web page or remote file, or the path to a local file, directly into the “Address” field. In any case, the file or object referred to in the Address field will be the target of the hyperlink.
    hyperlinks screen tip in excel
  • Here is an example of a screen tip in action:
    example screen tip report in hyperlink excel
  • You can also the use the Bookmark button to link to a very specific location (like a cell range) inside another Excel workbook. First, select the Excel file from the list in the large center area, and then click the Bookmark button.
  • You will then see the Select Place in Document dialog:
    Select Place in Document dialog
  • At this point, you can click to select the specific worksheet that you want to link to and type in a specific cell reference. 
  • When you have finished making the necessary entries in the dialog box, click OK to return to the Insert Hyperlink dialog. For whatever type of hyperlink you specify, once you have chosen the correct settings, click OK to create your link.
ok menu hyperlink

Editing Hyperlinks


To change the displayed text of an existing hyperlink, you can select the cell that contains the link, and then edit the link text in the formula bar:
display text of an existing hyperlink in excel

You can also right-click the hyperlink and click Edit Hyperlink: 
edit hyperlink in excel
This action will display the Edit Hyperlink dialog, which is almost identical to the Insert Hyperlink dialog. 
edit hyperlinks dialog in excel
You can now change the target for the hyperlink, the ScreenTip, or the text to display. You can also remove the hyperlink from the worksheet by clicking Remove Link. Once you are ready to commit to your modifications, click OK.

Formatting Hyperlink


Hyperlinks will generally appear in bright blue before they have been clicked and purple after they have been clicked. You can change the font color and size for an individual hyperlink by right-clicking it and choosing Format Cells:
format cells

This will display the Format Cells dialog box, which you can use to modify the font characteristics, border, shading, and alignment of the link.
format cells dialog box

The method just described will allow you to format individual hyperlinks; but what about modifying the default color and font size for all hyperlinks?

To start, click the Cell styles button in the Style group on the Home tab. From the options that appear, find the Hyperlink style, right-click it, and choose Modify:
hyperlink styles

The Style dialog will then open:
style dialog.jpg

Make sure that the word Hyperlink is visible in the “Style name” text box at the top of the dialog. You should also see a check mark next to the word “Font” in the column of checkboxes on the left. This means that the style for hyperlinks currently includes only font settings.

Next, click the Format button in the upper right of the dialog to open the Format Cells dialog.
Here, you can make changes to the appearance of all hyperlinks:

format cells to change all appearance

When you are finished modifying the hyperlink style, click OK in the Format Cells dialog.

You will now see the Style dialog again, with checkmarks corresponding to the style changes you made in the Format Cells dialog. If you are finished, click OK in the Style dialog to implement the changes.
style dialog implement changes

Now every new hyperlink you create, along with the existing ones, will have this new style by default.

new style hyperlink


Using Hyperlink in Excel


To follow a hyperlink in Excel, let your mouse pointer hover over it until a pointing hand appears. When you see the hand, left click the mouse and the target for the link will be opened with a program that is suited to do so. For example, if you click a link to a Word document, the document will open in Microsoft Word. If you click a link to a web page, the page will open with your default Internet browser.

The following worksheet contains a hyperlink to a Word document.
worksheet contains a hyperlink to a Word document

You can see that the first link (in cell D19) is now purple, meaning that it has been followed. You should also notice that the linked document has opened in Microsoft Word.

This action will display the Insert Function dialog, from which you can select the Hyperlink function:

insert function hyperlink

If you select HYPERLINK and click OK in the dialog, the Function Arguments dialog box will appear.

hyperlink function arguments

In the “Link_location” text box, you can specify the target of the link. This can be a web page URL, a local file, or a file on a network server. In the “Friendly_name” box, you can specify the particular text or number that will be visible in the spreadsheet. When you click OK, the link will be inserted into the spreadsheet.

You can also specify an image or other graphics as a hyperlink in your spreadsheet. To do this, just click the image and click Insert → Hyperlink:

hyperlink using images in excel

This action will display the same Insert Hyperlink dialog that we saw earlier. Use the Insert Hyperlink dialog to specify the target of the hyperlink, and then click OK to associate the linked location to the image. Once you have created the link, if you click on the image the link will be followed to its target, just like a regular hyperlink. You can edit and remove it in the same way.