Macro to fix Hyperlinks in Excel 2010

  John1083 20:47 10 Apr 2015
Locked

Hello,

I have an Excel 2010 spreadsheet with over 2000 files hyperlinks are not work. It needs to fix every single one. So that, I am try to run a MACRO to do it, but there's a error keep coming up. Following the what I did and it not working:

Sub Macro2() ' ' Macro2 Macro '

' ActiveWindow.SmallScroll Down:=3 Range("D22").Select Selection.Hyperlinks(1).Address = _ "F:\FILE-10" Range("D23").Select Selection.Hyperlinks(1).Address = _ "F:\FILE-11" Range("D24").Select Selection.Hyperlinks(1).Address = _ "F:\FILE-12" End Sub

After it, I rewrite it for all row in this spreadsheet:

Sub Macro2() Dim LastRow As Long, iRow As Long LastRow = ActiveSheet.Columns(22).Find("*", searchdirection:=xlPrevious).Row For iRow = 3 To LastRow ActiveSheet.Hyperlinks.Add Anchor:=Cells(iRow, 21), Address:=Cells(iRow, 22).Value, TextToDisplay:=Cells(iRow, 22).Value Next iRow End Sub

But its not working and highlight in yellow with ------ ActiveSheet.Hyperlinks.Add Anchor:=Cells(iRow, 21), Address:=Cells(iRow, 22).Value, TextToDisplay:=Cells(iRow, 22).Value

Does anyone know how to solve it??

Thank you so much!!!!

  John1083 19:41 11 Apr 2015

I have an Excel 2010 spreadsheet with over 2000 files hyperlinks are not work. It needs to fix every single one. So that, I am try to run a MACRO to do it, but there's a error keep coming up. Following is what I did and it not working:

Sub Macro2() ' ' Macro2 Macro ' ' Keyboard Shortcut: Ctrl+q ' Range("D22").Select Selection.Hyperlinks(1).Address = _ "F:\FILE-12.pdf" Range("D23").Select Selection.Hyperlinks(1).Address = _ "F:\FILE-13.pdf" Range("D24").Select Selection.Hyperlinks(1).Address = _ "F:\FILE-14.pdf" End Sub

After it, I rewrite it for all row in this spreadsheet:

Sub Macro2()

Dim LastRow As Long, iRow As Long

LastRow = ActiveSheet.Columns(22).Find("*", searchdirection:=xlPrevious).Row

For iRow = 22 To LastRow

ActiveSheet.Hyperlinks.Add Anchor:=Cells(iRow, 21), Address:=Cells(iRow, 22).Value, TextToDisplay:=Cells(iRow, 22).Value

Next iRow

End Sub

But its not working and highlight in yellow with ------ ActiveSheet.Hyperlinks.Add Anchor:=Cells(iRow, 21), Address:=Cells(iRow, 22).Value, TextToDisplay:=Cells(iRow, 22).Value ---- (This is error, I guess)

Does anyone know how to solve it??

Thank you so much!!!!

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Fujitsu Lifebook P727 laptop review

Best of the Grad Shows 2017: University of the West of England (UWE)

Best value Mac: Which is the best £1249 Mac to buy

Les meilleures GoPro 2017