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: Converting to Hyperlinks in a Shared Workbook.

Converting to Hyperlinks in a Shared Workbook

Written by Allen Wyatt (last updated March 4, 2021)
This tip applies to Excel 97, 2000, 2002, and 2003


1

Eric has a shared workbook that contains a database of some 3,500 records. Two of the cells in each record contain an e-mail address and a URL. When a new record is added to the database, the e-mail address and URL appear as regular text instead of as hyperlinks. To make them into hyperlinks Eric must unshare the workbook, make the change, and then reshare the workbook. Eric wondered if there is, perhaps, an easier way to handle this situation.

Quite simply, adding and editing hyperlinks is not allowed when using a shared workbook. The simplest way around it is to put the links in separate cells as text and then use the HYPERLINK formula to reference those cells.

For example, if the URL is entered into cell E2, you could use the following formula in a different cell:

=HYPERLINK(E2, E2)

The first argument in this formula is to the cell that contains the address and the second argument is for the text to be displayed for the hyperlink. This approach requires two additional columns (for the HYPERLINK formulas) but will not require unsharing and resharing the workbook.

The only other option is to create a macro that can automate the process of unsharing and resharing the workbook. The following macro will do this and convert whatever is in the selected cell into a hyperlink.

Sub AddHyperlink()
    Dim cell As Range

    Application.DisplayAlerts = False

    ' Unshare the Workbook
    If ActiveWorkbook.MultiUserEditing Then
        ActiveWorkbook.ExclusiveAccess
    End If

    ' Change address in cell to a hyperlink.
    If ActiveCell = "" Then
        ActiveCell.Hyperlinks.Delete
    Else
        For Each cell In Intersect(Selection, _
          Selection.SpecialCells(xlConstants, xlTextValues))
            With Worksheets(1)
                .Hyperlinks.Add Anchor:=cell, _
                  Address:=cell.Value, _
                  ScreenTip:=cell.Value, _
                  TextToDisplay:=cell.Value
            End With
        Next cell
    End If

    ' Reshare the Workbook
    If Not ActiveWorkbook.MultiUserEditing Then
        ActiveWorkbook.SaveAs _
          Filename:=ActiveWorkbook.FullName, _
          AccessMode:=xlShared
    End If
End Sub

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3155) 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: Converting to Hyperlinks in a Shared Workbook.

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

Adding a Missing Closing Bracket

When working with large amounts of data, it is a good idea to make sure that the data all consistently follows a pattern. ...

Discover More

Renaming a Style

Styles are invaluable when it comes to applying consistent formatting in and across documents. If you need to rename a ...

Discover More

Using Multiple Tables of Contents

Adding multiple tables of contents is a must for some types of document design. Here's a great overview of how you can ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (menu)

Using Drag-and-Drop to Create a Hyperlink

If you open workbooks in two instances of Excel, you can use drag-and-drop techniques to create hyperlinks from one ...

Discover More

Drop-Down List of Hyperlinks

Creating a drop-down list with Excel's data validation feature can be a nice touch for a worksheet. What if you want the ...

Discover More

Editing a Hyperlink

Excel will cheerfully keep track of all sorts of hyperlinks for you. If you want to change the hyperlink in some way, ...

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}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. 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 1 + 1?

2016-09-03 15:14:40

domingo isip

Here is something you most probably know but since I am new to your site, I have yet to see it discussed.

Re converting a link to hyperlink, I have a simple way to doing that.

Do this example ... Copy a URL ...

https://docs.oracle.com/javase/tutorial/networking/urls/definition.html

Then paste it on an Excel cell.
Go one line beneath it and
Press Ctrl and the tile left of ENTER to copy.

The copy line is the hyperlink.






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.