Hyperlink removal

R

Raider917

is there any way to remove all the links all at once? i copied a web
page with a list of over 300 names onto an excel sheet. now the sheet
has a hyper link for each name in that list. i can remove the links
individually but am wondering if there is an easier way.
 
P

Paul B

Raider917, with VBA,

for a range
Range("A2:A999").Hyperlinks.Delete

for the whole sheet
Cells.Hyperlinks.Delete


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
D

David McRitchie

You could use a web search -- you would be best sticking to
actual sites with Excel information rather than those that highjack
newsgroups. For instance clearing out the format from a cell
does NOT remove the hyperlink. Writing a macro with a specific
range is not a good idea either, you want something general purpose
using either

Selection.Hyperlinks.Delete ' to act on a selection
--or--
ActiveSheet.HyperLinks.Delete ' to remove all hyperlinks

the second is not necessary because if means creating another macro
when all you had to do was first select all cells for actual macro and details see:

Removing object hyperlinks from a Cell or cell range (#DelHyperlinks)
http://www.mvps.org/dmcritchie/excel/buildtoc.htm#DelHyperlinks
for instructions to install and use a macro see
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
R

Raider917

Paul said:
Raider917, with VBA,

for a range
Range("A2:A999").Hyperlinks.Delete

for the whole sheet
Cells.Hyperlinks.Delete




i did this but keep getting:

Compile error:

Invalid outside procedure
 
D

David McRitchie

look at my answer and at the web pages, because you must
install the macro and macros have a SUB at the beginning
and END SUB at the end.

You could enter that code into the Intermediate Window in the
Visual Basic Editor (Ctrl+G) but that would not help you for future
use.

 
Top