Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default How to remove hyperlink from a cell using VBA code

Is there a way, using VBA code, to remove a hyperlink from a cell, while
retaining the cell text content?

Thanks,

Keith



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default How to remove hyperlink from a cell using VBA code

Sub hypergone()
Dim r As Range
For Each r In Selection
r.Hyperlinks.Delete
Next
End Sub

Try this. On my machine the link is gone, but the text lingers on.
--
Gary's Student


"keithb" wrote:

Is there a way, using VBA code, to remove a hyperlink from a cell, while
retaining the cell text content?

Thanks,

Keith




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to remove hyperlink from a cell using VBA code

Hi Gary's Student,

Try this. On my machine the link is gone, but the text lingers on.


Try adding an additional line:

Sub hypergone()
Dim r As Range
For Each r In Selection
r.Hyperlinks.Delete
r.Clear
Next
End Sub

---
Regards,
Norman



"Gary's Student" wrote in message
...
Sub hypergone()
Dim r As Range
For Each r In Selection
r.Hyperlinks.Delete
Next
End Sub

Try this. On my machine the link is gone, but the text lingers on.
--
Gary's Student


"keithb" wrote:

Is there a way, using VBA code, to remove a hyperlink from a cell, while
retaining the cell text content?

Thanks,

Keith






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to remove hyperlink from a cell using VBA code

Hi Gary,

Please ignore my suggestion.

I missed the OP's requirement to *retain* the text!

My apologies.

---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Gary's Student,

Try this. On my machine the link is gone, but the text lingers on.


Try adding an additional line:

Sub hypergone()
Dim r As Range
For Each r In Selection
r.Hyperlinks.Delete
r.Clear
Next
End Sub

---
Regards,
Norman



"Gary's Student" wrote in message
...
Sub hypergone()
Dim r As Range
For Each r In Selection
r.Hyperlinks.Delete
Next
End Sub

Try this. On my machine the link is gone, but the text lingers on.
--
Gary's Student


"keithb" wrote:

Is there a way, using VBA code, to remove a hyperlink from a cell, while
retaining the cell text content?

Thanks,

Keith








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default How to remove hyperlink from a cell using VBA code

Thanks for the help. One related question:

What properties of a Range can I set so that text within the range is not
interpreted as a URL in the first place?

Thanks again,

Keith

"Norman Jones" wrote in message
...
Hi Gary,

Please ignore my suggestion.

I missed the OP's requirement to *retain* the text!

My apologies.

---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Gary's Student,

Try this. On my machine the link is gone, but the text lingers on.


Try adding an additional line:

Sub hypergone()
Dim r As Range
For Each r In Selection
r.Hyperlinks.Delete
r.Clear
Next
End Sub

---
Regards,
Norman



"Gary's Student" wrote in
message ...
Sub hypergone()
Dim r As Range
For Each r In Selection
r.Hyperlinks.Delete
Next
End Sub

Try this. On my machine the link is gone, but the text lingers on.
--
Gary's Student


"keithb" wrote:

Is there a way, using VBA code, to remove a hyperlink from a cell,
while
retaining the cell text content?

Thanks,

Keith












  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to remove hyperlink from a cell using VBA code

Why, that should retain the text.

or just
Activesheet.Hyperlinks.delete

I believe will also do it.

--
Regards,
Tom Ogilvy

"Norman Jones" wrote in message
...
Hi Gary,

Please ignore my suggestion.

I missed the OP's requirement to *retain* the text!

My apologies.

---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Gary's Student,

Try this. On my machine the link is gone, but the text lingers on.


Try adding an additional line:

Sub hypergone()
Dim r As Range
For Each r In Selection
r.Hyperlinks.Delete
r.Clear
Next
End Sub

---
Regards,
Norman



"Gary's Student" wrote in

message
...
Sub hypergone()
Dim r As Range
For Each r In Selection
r.Hyperlinks.Delete
Next
End Sub

Try this. On my machine the link is gone, but the text lingers on.
--
Gary's Student


"keithb" wrote:

Is there a way, using VBA code, to remove a hyperlink from a cell,

while
retaining the cell text content?

Thanks,

Keith










  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to remove hyperlink from a cell using VBA code

Hi Tom,

Why, that should retain the text.


For me, the line

r.Clear


cleared the residual text and, hence, my apology.

---
Regards,
Norman



"Tom Ogilvy" wrote in message
...
Why, that should retain the text.

or just
Activesheet.Hyperlinks.delete

I believe will also do it.

--
Regards,
Tom Ogilvy

"Norman Jones" wrote in message
...
Hi Gary,

Please ignore my suggestion.

I missed the OP's requirement to *retain* the text!

My apologies.

---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Gary's Student,

Try this. On my machine the link is gone, but the text lingers on.

Try adding an additional line:

Sub hypergone()
Dim r As Range
For Each r In Selection
r.Hyperlinks.Delete
r.Clear
Next
End Sub

---
Regards,
Norman



"Gary's Student" wrote in

message
...
Sub hypergone()
Dim r As Range
For Each r In Selection
r.Hyperlinks.Delete
Next
End Sub

Try this. On my machine the link is gone, but the text lingers on.
--
Gary's Student


"keithb" wrote:

Is there a way, using VBA code, to remove a hyperlink from a cell,

while
retaining the cell text content?

Thanks,

Keith












  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to remove hyperlink from a cell using VBA code

Well than all you needed to do was say to delete that line. Everything else
was good.

--
Regards
Tom Ogilvy


"Norman Jones" wrote in message
...
Hi Tom,

Why, that should retain the text.


For me, the line

r.Clear


cleared the residual text and, hence, my apology.

---
Regards,
Norman



"Tom Ogilvy" wrote in message
...
Why, that should retain the text.

or just
Activesheet.Hyperlinks.delete

I believe will also do it.

--
Regards,
Tom Ogilvy

"Norman Jones" wrote in message
...
Hi Gary,

Please ignore my suggestion.

I missed the OP's requirement to *retain* the text!

My apologies.

---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Gary's Student,

Try this. On my machine the link is gone, but the text lingers on.

Try adding an additional line:

Sub hypergone()
Dim r As Range
For Each r In Selection
r.Hyperlinks.Delete
r.Clear
Next
End Sub

---
Regards,
Norman



"Gary's Student" wrote in

message
...
Sub hypergone()
Dim r As Range
For Each r In Selection
r.Hyperlinks.Delete
Next
End Sub

Try this. On my machine the link is gone, but the text lingers on.
--
Gary's Student


"keithb" wrote:

Is there a way, using VBA code, to remove a hyperlink from a cell,

while
retaining the cell text content?

Thanks,

Keith














  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to remove hyperlink from a cell using VBA code

Hi Tom,

Well than all you needed to do was say to delete that line. Everything
else
was good


The 'good' part was Gary's Student's code.

My sole contribution was the offending line - hence my apology!


---
Regards,
Norman



"Tom Ogilvy" wrote in message
...
Well than all you needed to do was say to delete that line. Everything
else
was good.

--
Regards
Tom Ogilvy


"Norman Jones" wrote in message
...
Hi Tom,

Why, that should retain the text.


For me, the line

r.Clear


cleared the residual text and, hence, my apology.

---
Regards,
Norman



"Tom Ogilvy" wrote in message
...
Why, that should retain the text.

or just
Activesheet.Hyperlinks.delete

I believe will also do it.

--
Regards,
Tom Ogilvy

"Norman Jones" wrote in message
...
Hi Gary,

Please ignore my suggestion.

I missed the OP's requirement to *retain* the text!

My apologies.

---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Gary's Student,

Try this. On my machine the link is gone, but the text lingers on.

Try adding an additional line:

Sub hypergone()
Dim r As Range
For Each r In Selection
r.Hyperlinks.Delete
r.Clear
Next
End Sub

---
Regards,
Norman



"Gary's Student" wrote in
message
...
Sub hypergone()
Dim r As Range
For Each r In Selection
r.Hyperlinks.Delete
Next
End Sub

Try this. On my machine the link is gone, but the text lingers on.
--
Gary's Student


"keithb" wrote:

Is there a way, using VBA code, to remove a hyperlink from a cell,
while
retaining the cell text content?

Thanks,

Keith
















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
Remove Cell Color after Code is Deleted [email protected] Excel Discussion (Misc queries) 4 February 20th 07 07:37 PM
I cannot remove a hyperlink (mail to) in a cell ScarlotteMCM Excel Worksheet Functions 2 October 11th 06 05:39 PM
remove hyperlink of many cell at a time? rai Excel Discussion (Misc queries) 1 September 10th 06 04:17 AM
Can I remove a hyperlink without removing the color of the cell? wendy Excel Discussion (Misc queries) 1 April 13th 06 05:02 PM
How to remove Hyperlink without changing cell format? JAB Excel Worksheet Functions 1 January 20th 06 07:08 PM


All times are GMT +1. The time now is 11:34 PM.

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

About Us

"It's about Microsoft Excel"