The behaviour 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.
Since Excel 2000, the automatic creation of hyperlinks can be disabled by reconfiguring the AutoCorrect settings. Here is the procedure:
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.
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:
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.
TechRepublic is the online community and information resource for all IT professionals, from support staff to executives. We offer in-depth technical articles written for IT professionals by IT professionals. In addition to articles on everything from Windows to e-mail to firewalls, we offer IT industry analysis, downloads, management tips, discussion forums, and e-newsletters.
©2004 TechRepublic, Inc.



8%
1%






