Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
San San is offline
external usenet poster
 
Posts: 14
Default Removing hyperlink without removing the font settings /border sett

The below code removes hyperlinks
Sub ZapHyperlinks()
Cells.Hyperlinks.Delete
End Sub
However it also removes the formatting(color/border) of the cell .
Any idea on how to protect the format of the cell
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Removing hyperlink without removing the font settings /border sett

Maybe something like this:

Sub ZapHyperlinks()
Set sh = ActiveSheet
ActiveSheet.Copy After:=Worksheets(Worksheets.Count)
Set sh1 = ActiveSheet
sh.Activate
Set r = Selection
Cells.Hyperlinks.Delete
sh1.Cells.Copy
sh.Cells.PasteSpecial xlFormats
r.Select
Application.DisplayAlerts = False
sh1.Delete
Application.DisplayAlerts = True
End Sub

--
Regards,
Tom Ogilvy

"San" wrote:

The below code removes hyperlinks
Sub ZapHyperlinks()
Cells.Hyperlinks.Delete
End Sub
However it also removes the formatting(color/border) of the cell .
Any idea on how to protect the format of the cell

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Removing hyperlink without removing the font settings /border sett

Another way:

Sub hyper_be_gone()
For Each r In ActiveSheet.UsedRange
If r.Hyperlinks.Count 0 Then
r.ClearContents
End If
Next
End Sub

--
Gary''s Student - gsnu200747


"San" wrote:

The below code removes hyperlinks
Sub ZapHyperlinks()
Cells.Hyperlinks.Delete
End Sub
However it also removes the formatting(color/border) of the cell .
Any idea on how to protect the format of the cell

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
removing more than one hyperlink dkb43 Excel Discussion (Misc queries) 2 January 25th 09 04:42 AM
Removing Hyperlink joaniemic Excel Worksheet Functions 4 April 30th 08 04:49 PM
Removing Mail to: hyperlink option ABI Excel Discussion (Misc queries) 1 June 4th 07 12:34 PM
Removing Hyperlink Shawn Excel Discussion (Misc queries) 2 May 16th 05 04:11 PM
Removing hyperlink Frank Marousek Excel Discussion (Misc queries) 3 January 12th 05 09:53 PM


All times are GMT +1. The time now is 12:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"