Written by Allen Wyatt (last updated March 4, 2021)
This tip applies to Excel 97, 2000, 2002, and 2003
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:
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.
Dive Deep into Macros! Make Excel do things you thought were impossible, discover techniques you won't find anywhere else, and create powerful automated reports. Bill Jelen and Tracy Syrstad help you instantly visualize information to make it actionable. You’ll find step-by-step instructions, real-world case studies, and 50 workbooks packed with examples and solutions. Check out Microsoft Excel 2019 VBA and Macros today!
Need to get rid of all the hyperlinks in a worksheet? It's easy when you use this single-line macro.
Discover MoreIf you need to modify the URL used in a large number of hyperlinks, you can do so by using a macro and a little ...
Discover MoreExcel allows you to open HTML pages within the program, which is great for some purposes. What if you want to open a ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2016-09-03 15:14:40
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.
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.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments