Software

Prevent the automatic creation of hyperlinks in Microsoft Excel

You may not always want Microsoft Excel to automatically create hyperlinks as you enter them into a cell. Disabling this feature in Excel 2000, Excel 2002, and Excel 2003 can be accomplished by changing AutoCorrect settings or with a VBA macro.

Problem


The behavior of Microsoft Excel with regard to URLs entered into a cell is to automatically create a clickable hyperlink. However, circumstances may arise in which you want to disable that feature. Preventing the automatic creation of hyperlinks can be accomplished in three dramatically different ways.


Microsoft Knowledge Base Article - 291209


Additional information and explanation for these solutions can be found at Microsoft Knowledge Base Article – 291209.


Solution 1


Since Excel 2000, the automatic creation of hyperlinks can be disabled by reconfiguring the AutoCorrect settings. Here is the procedure:

  • Navigate to Tools | AutoCorrect options in the Excel menu.
  • Click the AutoFormat As You Type tab.
  • Under Replace As You Type, uncheck Internet And Network Paths With Hyperlinks.

In Excel 2003, you will also be given the option of turning off this AutoCorrect feature with the action dialog that appears after entering the first URL.

Solution 2


Entering URLs into a cell as a label will also prevent the automatic creation of a hyperlink in Excel. A label is indicated by preceding the cell entry with an apostrophe. For example, enter a URL as:

  • 'http://techrepublic.com

Solution 3


This solution is much more involved then the previous two and uses VBA code. It is a good example of how program-level event handlers in VBA can be used to dynamically change how Excel behaves toward entered data. While this method will certainly disable the automatic creation of hyperlinks in Excel, it may be a little over-the-top for most situations. However, if you need to systematically disable the automatic creation of hyperlinks for some reason, this is probably the best way to ensure it.

The VBA code is taken directly from the Microsoft Knowledge Base, Article 291209.

  1. Start a new worksheet and start the Microsoft Visual Basic Editor (press ALT+F11).
  2. Insert this VBA code into that module.
  3. Switch to the Project Explorer window and click This Workbook.
  4. Insert this VBA code into that module.
  5. Save the file.
  6. Run the macro.

Once the macro is run, the automatic creation of hyperlinks is disabled. You can place this macro in the Excel startup folder if you want it to run every time Excel is started.

About Mark Kaelin

Mark W. Kaelin has been writing and editing stories about the IT industry, gadgets, finance, accounting, and tech-life for more than 25 years. Most recently, he has been a regular contributor to BreakingModern.com, aNewDomain.net, and TechRepublic.

Editor's Picks