Sei sulla pagina 1di 14

Excel Hyperlinks, What are they and how to use them in your workbooks. | Chandoo....

Page 1 of 14

Beam Me Up Scotty Excel Hyperlinks


Posted on March 31st, 2011 in Excel Howtos , Huis , Posts by Hui - 25 comments

What are Hyperlinks ?


A Hyperlink is a reference to a document, a location or an action that the reader can directly
follow by selecting the link.

Hyperlinks are used extensively on the Internet and are generally Words highlighted in
Underlined Blue < Like that.

The use of Hyperlinks in Excel has been extended to a number of areas and this includes:

Opening Files (of any type)


Opening Web Pages (Internet or Intranet)
Jumping/Navigating to locations within an existing document
Creating New Documents (Excel files only)
Sending Emails

Microsoft has added the ability to place Hyperlinks,

Directly on an Excel worksheet ,


Connected to a number of worksheet objects, including shapes, charts and wordart
Included as a worksheet formulas.
Programmatically using VBA

These 4 methods above will be discussed here.

Inserting Hyperlinks
As described above there are 4 methods for inserting hyperlinks in an Excel Workbook.

http://chandoo.org/wp/2011/03/31/excel-hyperlinks/ 13/11/2013
Excel Hyperlinks, What are they and how to use them in your workbooks. | Chandoo.... Page 2 of 14

Directly on an Excel worksheet

There are 3 ways to insert a Hyperlink directly into a cell, either:

Right click on the cell and select Hyperlink; or

Use the Insert, Hyperlinks Tab; or

Use a Keyboard Shortcut - Ctrl K

Connected to a number of worksheet objects, including shapes, charts


and wordart

You can also add a Hyperlink to many objects within Excel including Pictures, Shapes, Text
Boxes, Word Art and Charts.

http://chandoo.org/wp/2011/03/31/excel-hyperlinks/ 13/11/2013
Excel Hyperlinks, What are they and how to use them in your workbooks. | Chandoo.... Page 3 of 14

Right clicking a lot of these objects brings up the Objects Shortcuts Menu, select
Hyperlink,

or

Select the object, Use the Insert, Hyperlinks Tab; or

Select the Object and Use the Keyboard Shortcut Ctrl K

Hint: Right Clicking on Charts Doesnt Show the Add Hyperlink option, so Select the Chart
and Ctrl K

Adding Hyperlinks using Worksheet Formulas.

Hyperlinks can be added using worksheet formulas.

=HYPERLINK( Link Location, Name)

Link Location: This is the path and file name to the document to be opened.

The Link Location can refer to a place in a document such as a specific cell or named range
in an Excel worksheet or workbook, or to a bookmark in a Microsoft Word document. The
path can be to a file that is stored on a hard disk drive. The path can also be the path on a
server or a URL, HTTP or FTP and a location of an object, document, World Wide Web page,
or other destination on the Internet or an intranet. The Link Location can be a text string
enclosed in quotation marks or a reference to a cell that contains the link as a text string.

Name:This is the text or value that is displayed in the cell. The Name is displayed in blue
and is underlined.

Eg:

Jump to a cell on Another sheet

=HYPERLINK(Sheet3!B3,Monthly Budget)

The above will add a Hyperlink, titled Monthly Budget and link to Sheet3!B3 of the current
workbook

Jump to a Named Range on Another sheet

http://chandoo.org/wp/2011/03/31/excel-hyperlinks/ 13/11/2013
Excel Hyperlinks, What are they and how to use them in your workbooks. | Chandoo.... Page 4 of 14

=HYPERLINK(Budget,Yearly Budget)

The above will add a Hyperlink, titled Yearly Budget and link to the Named Range Budget
of the current workbook

Open a File on a network Drive

=HYPERLINK(//Server01\01 Administration\Administration.docx,Open Admin File)

The above will add a Hyperlink, titled Open Admin File and link to the file at: //Server01
\01 Administration\Administration.docx

Open a File on a network Drive at a specific bookmark

=HYPERLINK([//Server01\01 Administration\Administration.docx]Contents,Open Admin


File @ TOC)

The above will add a Hyperlink, titled Open Admin File @ TOC and link to the Named
Section Contents of the file at: //Server01\01 Administration\Administration.docx

Jump to a Web Page

=HYPERLINK(http://chandoo.org/wp/,Goto Chandoo.org)

The above will add a Hyperlink, titled Goto Chandoo.org and link to
http://chandoo.org/wp/

Send an Email

=HYPERLINK(mailto:chandoo.d@gmail.com,Email Chandoo)

The above will add a Hyperlink, titled Email Chandoo and send an email to
chandoo.d@gmail.com

Adding Hyperlinks Programmatically using VBA

Hyperlinks can be added to a worksheet or a worksheet object programmatically using some


simple code

Sheets(SheetName).Hyperlinks.Add Anchor:=Sheets(SheetName).Range(Range),
Address:=", SubAddress:=Address!Range, TextToDisplay:=Name

Where:

SheetName: The Name of the Sheet where the Hyperlink is to go

Range: The Range where the Hyperlink is to go

Address!Range: The address and Range linked to in the Hyperlink

Name: The Display Name of the Hyperlink

Types of Hyperlinks
There are 5 Types of Hyperlinks which Excel offers, each is described below:

Existing File
Existing Web Page
Place in This Document
Create a New Document
Send an Email Link

Existing File

http://chandoo.org/wp/2011/03/31/excel-hyperlinks/ 13/11/2013
Excel Hyperlinks, What are they and how to use them in your workbooks. | Chandoo.... Page 5 of 14

Select the existing File or Web Page icon in the Link to: area

Navigate to the existing file using the Look in: area of the dialog

Add your Display Text in the Text to display: area

Add a ScreenTip, a Tip which is displayed when you hover the mouse over a Hyperlink

Use the Bookmark button to jump to predefined Named Ranges and common Cell
References dialog

http://chandoo.org/wp/2011/03/31/excel-hyperlinks/ 13/11/2013
Excel Hyperlinks, What are they and how to use them in your workbooks. | Chandoo.... Page 6 of 14

Existing Web Page

Select the Existing File or Web Page icon in the Link to: area

Navigate to the existing file using the Look in: area of the dialog

Add your Display Text in the Text to display: area

Add a ScreenTip, a Tip which is displayed when you hover the mouse over a Hyperlink

Place in This Document

Select the Place in this Document icon in the Link to: area

Type in Cell Reference using the Type in Cell Reference: area of the dialog or select a
Defined Names in the Defined Names area

Add your Display Text in the Text to display: area

Add a ScreenTip, a Tip which is displayed when you hover the mouse over a Hyperlink

Create a New Document

http://chandoo.org/wp/2011/03/31/excel-hyperlinks/ 13/11/2013
Excel Hyperlinks, What are they and how to use them in your workbooks. | Chandoo.... Page 7 of 14

Select the Create New Document icon in the Link to: area

Type in the Name of the New Document in the Name of the New Document: area of the
dialog.

Add your Display Text in the Text to display: area

Add a ScreenTip, a Tip which is displayed when you hover the mouse over a Hyperlink

You can choose wether to Edit the File Now or Later in the When to Edit area

Send an Email Link

Select the Email Address icon in the Link to: area

Type in the Email Address in the Email Address: area of the dialog.

Add your Display Text in the Text to display: area

Add your Email Subject in the Subject: area

Add a ScreenTip, a Tip which is displayed when you hover the mouse over a Hyperlink.

http://chandoo.org/wp/2011/03/31/excel-hyperlinks/ 13/11/2013
Excel Hyperlinks, What are they and how to use them in your workbooks. | Chandoo.... Page 8 of 14

Editing Hyperlinks
Once you have a hyperlink established you can edit the hyperlink by right click on the
hyperlink and select Edit Hyperlink

The Edit Hyperlink dialog will vary depending on the type of Hyperlink as described above.

Deleting Hyperlinks
Once you have a hyperlink established you can delete the hyperlink by right click on the
hyperlink and select Remove Hyperlink

http://chandoo.org/wp/2011/03/31/excel-hyperlinks/ 13/11/2013
Excel Hyperlinks, What are they and how to use them in your workbooks. | Chandoo.... Page 9 of 14

Hyperlink Uses
Hyperlink can be used for a number of uses as described above.

Tables of Contents

One common use of hyperlinks is the creation of Tables of Contents.

The construction of a Table of Contents page was discussed here Table of Contents

The construction of Tables of Contents can also be automated using some simple VBA.

So instead of reinventing the wheel I will direct you to The Microsoft Office Blog where Tables
of Conents were recently discussed.

Table of Contents 1 or Table of Contents 2

Dealing with Lots of Hyperlinks

The following 2 posts at http://chandoo.org/forums have solved users problems and will
easily be adapted to other Hyperlink issues

Find Dead Hyperlinks

http://chandoo.org/forums/topic/check-broken-external-hyperlinks

Edit Hyperlinks

http://chandoo.org/forums/topic/marco-for-editing-link-in-workbook

http://chandoo.org/wp/2011/03/31/excel-hyperlinks/ 13/11/2013
Excel Hyperlinks, What are they and how to use them in your workbooks. | Chando... Page 10 of 14

How have you used Hyperlinks?


How have you used Hyperlinks?

Let us all know in the comments below:

25 Responses to Beam Me Up Scotty Excel Hyperlinks

1. Rich says:
March 31, 2011 at 1:28 pm

Ive just started using the formula version =HYPERLINK(S:\Reserving\Management


Judgment comments\check for MJ comments TOS 006 &TEXT(month,mmmm yyy)
&.xls,MJ Comments) and making it dynamic as some of the files that I use have a
new name each month, or even each day.

Reply

2. Dennis says:
March 31, 2011 at 6:38 pm

I have an Excel file called Important Stuff. Rather than use post it notes, I put
information I need into this file. I create hyperlinks to the files I most reference;
especially when I have many different versions. I then add comments in the cells next
to the hyperlinks to tell me what the differences are. I rarely have to search as
everything is right there in the one file.

Reply

3. Gregory says:
April 1, 2011 at 6:11 am

Great article! Im bookmarking this for reference. Thanks for putting all you need to
know about hyperlinks in one place.

Reply

4. Kevin says:
April 1, 2011 at 11:57 am

Hyperlinks are great but Hyperlinks for navigating a spreadsheet are lost if saved as a
pdf. Even if you are utilizing Adobe Writer 8.0.0

Reply

5. Patty says:
April 1, 2011 at 4:30 pm

Great info! I never thought of using hyperlinks in Excel. Mostly used them in Word,
email and especially in Powerpoint.

Reply

6. Bobby Bluford says:


April 2, 2011 at 11:13 pm

One cool thing I do is combine the hpyerlink function with a custom function I had help
in building. I have a list of contractors from our Accounting Software (Quickbooks). We
keep scanned copies of the 1099s in one folder. We can then download the data, which
includes the vendors TaxPayer ID. The formula then checks for the file. If it exists, it
provides a link to open it. If it doesnt it says so.

Here is the custom function code:


>>>>>>>>>>>>>>>>>>>>>>>>>
Public Function MyFileExists(MyFilePath As String) As Boolean

http://chandoo.org/wp/2011/03/31/excel-hyperlinks/ 13/11/2013
Excel Hyperlinks, What are they and how to use them in your workbooks. | Chando... Page 11 of 14

Dim objFSO As Object


Set objFSO = CreateObject(Scripting.FileSystemObject)
MyFileExists = objFSO.FileExists(MyFilePath)
Set objFSO = Nothing
End Function
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Bobby
BobbyBluford.com

Reply

7. Swapnil says:
April 4, 2011 at 5:37 am

This is aewsome. I have been using hyperlink since a long time. I like this option as
this helps me create my Dashboard like a webpage. Thanks for sharing this, I got more
insight of this option.

Reply

8. Cameron says:
April 8, 2011 at 3:35 pm

Bobby: Fantastic idea! Whats amazing is as soon as I started reading scanned copies
in your post I was thinking hey that would be cool if you could just link to the files if
and only if they exist. Then you described how you do exactly that!
Nice one.

Reply

9. Jon says:
April 14, 2011 at 12:43 pm

I use hyperlinks to jump from one location in a tab to another. When I add rows, the
hyperlink destination location does not reflect the rows I just inserted. Does anyone
know a way around this?

Reply

10. Hui... says:


April 14, 2011 at 1:40 pm

@All
If you like playing pranks on you co-workers or friends here is a simple Excel Hyperlink
prank.
.
Open a workbook, probably not an overly important one, and select a page then either
Use Ctrl A twice or select all the cells by clicking in the area to the upper left of A1.
Right click any cell and insert a Hyperlink, doesnt matter what its to, Another page, a
Web Site or Send an Email
close the file
.
When anybody opens the file and clicks anywhere on the page it will execute the
Hyperlink, even on a blank cell, where the Hyperlink isnt shown
This works particularly well on Blank worksheets
.
To remove right click anywhere on the page and Remove Hyperlinks

Reply

11. JJ says:
May 5, 2011 at 1:24 am

I have been wrestling hyperlinks to PDF files for over a year now, I can insert
hyperlinks fine, and they look beautiful, but when click on them it comes up with

http://chandoo.org/wp/2011/03/31/excel-hyperlinks/ 13/11/2013
Excel Hyperlinks, What are they and how to use them in your workbooks. | Chando... Page 12 of 14

Cannot Open the Specified File. Does anyone know if this is because PDFs are
unsupported by Excel or can other people get hyperlinks to PDFs working OK.
My application is a register of approved capital expenditure projects and the link is to a
PDF scan of the signed approved document.

Reply

12. Hui... says:


May 5, 2011 at 1:35 am

@JJ
What version of Excel are you using ?
and
What PDF Reader are you using ?
I assume you are using the Link to an Existing File or Web Page dialog?
Because that has worked as described for years without error

Reply

13. JJ says:
May 6, 2011 at 4:17 am

I am using excel 2007


The PDF reader I am using is Adobe Reader X.
So nothing really unusual.
I am using the Insert Ribbon, then the Hyperlink Icon.
I just had anohter play with it it seems to work OK if the PDF file is on my C drive,
but as soon as the PDF file is on a network drive it comes up with the error.

Reply
14. Create Dynamic Hyperlinks in Excel [Video] | Chandoo.org - Learn Microsoft Excel
Online says:
July 14, 2011 at 8:52 am

[...] Introduction to Excel Hyperlinks [...]

Reply

15. mabs says:


July 28, 2011 at 3:47 pm

Dear Bobby i think your solution is very near to my requriment but can please explain
in layman terms . I have a set of files in a folder let say a,b,c,d,e and i have a range of
column in excel a1,b1,c1,d1,e1 .So if i click cell a1 file a should open. For range of 5
cells we can hyperlink each cell but if i have 100s of cells and files How can i apply
hyperlink to all of them at once please explain

Reply

16. Mark says:


October 13, 2011 at 3:43 pm

Im using excel 2010 & adobe reader 10 getting the same error Cannot Open the
Specified File when linking to a file on a networked drive. File opens fine if its on my
PC.
Hope this helps.

Reply

17. Fiaz says:


November 9, 2011 at 2:34 pm

Say in cell Z1, I have the URL: http://www.microsoft.com

And, I have a rectangle shape near A1 and I want it to have a hyperlink and the
URL for the hyperlink should be the URL in cell Z1.

http://chandoo.org/wp/2011/03/31/excel-hyperlinks/ 13/11/2013
Excel Hyperlinks, What are they and how to use them in your workbooks. | Chando... Page 13 of 14

So, when someone clicking the Rect will be taken to http://www.microsoft.com

When the URL is changed in cell Z1 to say http://www.yahoo.com

Now, when clicking the Rect should take him to the new URL.

How to achieve this? Thanks.

Reply

18. Nanette says:


May 11, 2012 at 6:45 pm

I am using Excel 2007. I have a spreadsheet with hyperlinks that were created using
formulas, such as =HYPERLINK( Link Location, Name).

The hyperlinks work fine while I am in Excel, so I know they are active. However,
when I use Acrobat 10 Pro to pdf the spreadsheet (and select the option to Add
Links) the Web links are no longer active.

I imagine its because Acrobat cannot handle the behind the scenes commands such
as a formula, and then just uses the visible text in that particular cell.

Has anyone found a work-a-round for this problem?

Reply

19. Kevin says:


May 14, 2012 at 12:52 pm

The problem is that the hyperlinks in Excel are nothing more than cell references.
However the cell disappear when saving as .pdf.

In Powerpoint, the slide references can convert to pdf and continue to work.

Reply
20. Download Project Portfolio Dashboard Excel Template & Manage multiple projects with
ease | Chandoo.org - Learn Microsoft Excel Online says:
November 19, 2012 at 8:22 am

[...] Hyperlinks: for accessing other parts of the workbook & data [...]

Reply

21. Brad says:


November 20, 2012 at 3:26 pm

I have a single page dashboard created, where I would like each of the graphs to serve
as a hyperlink to the actual data that creates the graph. The problem Im running into
is the URL for the hyperlink can be very long, depending on the data used to create
the graph. Does anyone know how to get around the 255 characters limit Excel has on
URLs? I used =Hyperlink(A1)&Hyperlink(A2) without Excel returning an error, but
when I click on the link, it doesnt do anything. Any help would be greatly
appreciated.

Reply

22. ABZ says:


March 11, 2013 at 7:01 pm

I need to use hyperlink in excel to brows a web page according to each row
of a table that its data comes from a external source such a sql connection.
but the text I have genarated from sql query =hyperlink
(Http://somthing.com,WebPage)
appearing just like above text if i edit i in sheet for example adding some space after
of before text and accepting changes then link become a real link
any kelp!
I would be appreciate

http://chandoo.org/wp/2011/03/31/excel-hyperlinks/ 13/11/2013
Excel Hyperlinks, What are they and how to use them in your workbooks. | Chando... Page 14 of 14

Reply

23. Ben says:


April 5, 2013 at 9:34 pm

The simplest way to add web page links is:


1. In your browser, copy the url
2. Paste the url into a cell
3. Press F2
Done!

Reply

24. mohanraj says:


May 24, 2013 at 10:37 am

Hi Gents

i dont have not much knowledge about hyper link.Could please any

one can explain how hyper link has been working.

Reply

Hui... says:
May 24, 2013 at 2:45 pm

@Mohanraj

A hyperlink is like a shortcut


By selecti8ng the hyper link it takes you somewhere else

Hyperlinks can:
Take you some place else, like another sheet or workbook or open other file,
they dont even have to be an Excel file

Hyperlinks can be placed in cells, ranges or objects in Worksheets like Charts or


Rectangles etc, all of which trigger the hyper link when you click them

The post should tell you the rest of the story on how to use them

Reply

Leave a Reply

Form Controls Adding Interactivity to Your


March 2011 is best month ever and other news
Worksheets

http://chandoo.org/wp/2011/03/31/excel-hyperlinks/ 13/11/2013

Potrebbero piacerti anche