Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier 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 January 25, 2020)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


2

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

It should be noted that Microsoft removed the Shared Workbook feature in the latest versions of Excel. Co-authoring is the newer way to share workbooks. The following webpage explains how to access the Shared Workbook buttons if they are needed; for example, if you need to turn off the Shared Workbook feature:

https://support.office.com/en-us/article/What-happened-to-shared-workbooks-150FC205-990A-4763-82F1-6C259303FE05

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 (725) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel 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

Creating a Worksheet Copy by Default

Excel makes it relatively easy to copy worksheets to a different workbook. That doesn't mean it couldn't be made simpler ...

Discover More

Preventing the Insertion of Non-Breaking Spaces

When you copy and paste information from the Internet, you may end up with a lot of non-breaking spaces in the pasted ...

Discover More

Different Cell Movement in a Single Worksheet

You can configure Excel to specify what happens when you press Enter in a cell. This is normally done on a global basis, ...

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 (ribbon)

Automatic Text in an E-mail

When creating an e-mail address hyperlink using the Insert Hyperlink dialog box, Excel allows you to enter a subject for ...

Discover More

Generating a Web Page

Want your worksheets to be available to others on the Internet? Excel provides a way you can save your data in HTML ...

Discover More

Adding Excel Information to a Web Page

Besides saving a worksheet as a complete Web page, you can also save smaller portions of your data to an existing Web ...

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 two more than 7?

2014-12-13 09:06:42

Petros

Shared workbooks can be horrible, because several Excel features are unavailable in them. Hypelinks is one of them. Developers cannot write, record, change, view or assign macros, as VBA is unviewable. Users can only run existing macros that don't access unavailable features.

So until today, if you had to update macros in a shared workbook, you were out of luck. The only way was to unshare it, discard the change history, edit your macros and share the workbook again. Sometimes shared workbooks that have been made exclusive a couple of times lose data or settings or trigger odd errors.

Here is what you have to do to unlock macros in shared workbooks without unsharing the workbook and lose changes:

http://www.spreadsheet1.com/move-excel-vba-projects-from-one-workbook-to-another.html


2014-12-13 05:50:31

Claude Albertario

Another problem with hypertext is that when you reference a cell that contains hypertext, it does not show in the destination cell.
Even if you "Link" to the cell, the hypertext is non-evident.

Why is that?


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu 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.