Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Dynamic Hyperlinks in Excel.

Dynamic Hyperlinks in Excel

by Allen Wyatt
(last updated October 8, 2016)

3

You can create dynamic hyperlinks in Excel that act like HTML forms without having to know much at all about HTML. These hyperlinks can come in handy when using Excel as an interface to the Internet or to an internal Web.

As an example, let's create a Google search form. First, drop by Google.com and do a search for the keyword "Excel." Then, take a look at the URL in your browser's address bar. It may look something like this:

http://www.google.com/search?hl=en&q=Excel&lr=lang_en

Of course, what you see in the address bar could be even longer, depending on what server you end up accessing at Google:

http://www.google.com/#hl=en&sugexp=ldymls&xhr=t&q=Excel&cp=4
&pf=p&sclient=psy&site=&source=hp&aq=0&aqi=&aql=&oq=Exce&pbx=1
&bav=on.2,or.r_gc.r_pw.&fp=e28a97840bb57e9&biw=1311&bih=692

Regardless of the format shown in the address bar, if you study what you see, you'll start to recognize patterns. The parameters following either the question mark (?) or the hash mark (#) are the name-value pairs submitted by the HTML form. But, you don't need to know a whole lot about that. In this case, the main thing to consider is the search term, where "q" is the name of the parameter and "Excel" is the value.

Using the HYPERLINK function along with the CONCATENATE function (or just the ampersand, &), you can easily assemble a link and create a dynamic form using cells as fields. Just follow these two quick steps:

  1. In cell B3 enter the keyword "Excel Web Queries."
  2. In cell B4, enter the following formula:
=HYPERLINK("http://www.google.com/search?q="&B3&"&safe=active","Search Google")

Now you have your own simple HTML form inside of Excel. You can create much longer hyperlinks and include multiple cell references, but there is a limit in Excel to how long the hyperlink can be (about 248 characters). To use the form, just enter your keywords into cell B3 and click on the hyperlink in cell B4. That's it!

Creating a form to access Google is just a simplistic example. The interesting applications are when you can assemble hyperlinks from the results of calculations, string manipulation, IF statements, combo boxes, or the other form fields available in Excel.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2445) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Dynamic Hyperlinks in Excel.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Rounding Up to the Next Half

When processing data it is not unusual to need to round that data in some way. For instance, you may need to round a value ...

Discover More

Checking Lock Status of Cells

When you first create a worksheet, all the cells in that worksheet are formatted as locked. As you unlock various cells on ...

Discover More

Using Fields for Fractions

Want a quick way to create fractions? You can do it by using fields, as described in this tip.

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (menu)

Deleting a Hyperlink

Hyperlinks can be helpful in some worksheets but bothersome in others. Here's how to get rid of any hyperlinks you don't ...

Discover More

Removing Hyperlinks without a Macro, Take Two

Need to get rid of hyperlinks in a worksheet? Here's an easy way to do it without using a macro.

Discover More

Hyperlinks to Charts

You can create hyperlinks to all sorts of worksheets in a workbook, but you cannot create a hyperlink to a chart sheet. This ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 7 + 7?

2017-03-18 18:07:19

Andrew Jones

Hi Allen,

Thanks for the article. I can now see how I can create hyperlinks straight of excel to sites. Is it possible to create a hyperlink to a website off a chart element? Say, a label? This would be very useful for me.

Thanks,
Andrew


2017-01-28 15:21:46

daniel

Okay, got that. Thanks.
Now, it won't evaluate. That is, go to the website, retrieve the information and display it in the cell. It just shows the URL; if I click it a new tab opens in my browser.


2016-12-13 10:51:17

Gus

This worked great for me. I made a list of online stores to search for the keyword I enter in B3. However; some of the sites I would like to include use secondary search windows with no discernible URL. And then there are encoded sites that use
search.php?encode=
followed by a lot of gibberish. Is there any way around these obstacles without getting all into VB?


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.