Function: mailto

H

Hopeful Waiter

I have an Excel worksheet that I was given. All the addresses are
mailto hyperlinks. This is OK when the spreadsheet is complete and
correct, however, when it is being edited, it is a pain. Is there a
way to select all the addresses and turn the hyperlinks off, and then,
when you are finished, turn all the hyperlinks back on? I don't mean
address by address...

Thank you for your time.
 
M

Mike Barton

Drop the following code into a VBA Module.
Sub HyperlinksOff()
Selection.Hyperlinks.Delete
End Sub

Sub HyperlinksOn()
Dim oCell As Range
Dim strTextToDisplay As String

For Each oCell In Selection
If Not IsEmpty(oCell) Then
strTextToDisplay = oCell.Value
oCell.Hyperlinks.Add Anchor:=Selection, Address:=strTextToDisplay
End If
Next
End Sub

Select the range before you run either macro.

Mike Barton
 
H

Hopeful Waiter

Good morning Mike!

Thanks for taking the time to answer. I don't know how to use VBA
Modules (yet), but now I know where to go now. I bet I can figure it
out. Thanks again for your kindness.

Hopeful Waiter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top