Macro Hyperlink Problem

Jack O Macro

New Member
Joined
Mar 21, 2011
Messages
2
For years I have used the following macro to hyperlink multiple www.anyurlon theweb.com addresses.

For some reason the hyperlink seems to be busted. It seems to hyperlink ok but it does not put in the http:// and thus when I click on the cell I get a "cannot open the specified file" error. So I end up having to 'right-click' and insert the http:// by hand then it will work.

I think my virus software may have damaged the macro, can you review the macro and tell me how to fix it??

Sub MakeHyperlinks()
Dim cell As Range
For Each cell In Intersect(Selection, _
Selection.SpecialCells(xlConstants, xlTextValues))
With Worksheets(1)
.Hyperlinks.Add Anchor:=cell, _
Address:=cell.Value, _
ScreenTip:=cell.Value, _
TextToDisplay:=cell.Value
End With
Next cell
End Sub
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hello Jack O Macro,

Check your Auto Correct Options under Tools.


  • Under Tools click AutoCorrect Options...
  • Select the AutoFormat As you Type tab on the dialog.
  • Make sure the checkbox under Replace as you type is checked.
  • If not click the checkbox to set it.

Sincerely,
Leith Ross
 
Upvote 0
The fix did not work. It did however allow me to type in a url and it did auto hyperlink it which was nice but when I ran the macro again it did the same thing.

The same thing is: Take a url such as www.google.com that IS NOT hyper linked and it changes it to www.google.com with a blue underline so it looks like it is hot but it does not work. When I right click the URL to 'edit hyperlink' is missing the http:// and when I put it in it it works. So in a sense it is working only 50%.
 
Upvote 0

Forum statistics

Threads
1,224,508
Messages
6,179,189
Members
452,893
Latest member
denay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top