• edit hyperlinks (Excel 2000)

    Author
    Topic
    #395829

    I have an several images in excel which links to a hyperlink. I would like to change the directory name in all of them at once with a search and replace function, like you can in the formulas? Does anyone know how to do this?

    Viewing 1 reply thread
    Author
    Replies
    • #737579

      Here is a Simple find/replace. You could enhance it to ask for the old and new in an input box if desired.

      Steve

      Sub FixHyperlink()
          Dim wks As Worksheet
          Dim hlink As Hyperlink
          Dim sOld As String
          Dim sNew As String
          
          Set wks = ActiveSheet
          sOld = "OldPath"
          sNew = "NewPath"
      
          For Each hlink In wks.Hyperlinks
              hlink.Address = Application.WorksheetFunction. _
                  Substitute(hlink.Address, sOld, sNew)
          Next hlink
          Set wks = Nothing
      End Sub
      • #737595

        Thanks Steve, this worked great…Susan

        • #737652

          Hi Steve: I just had two questions relating to this macro. The first is, now I get an excel edit box every time I open the worksheet. How can I remove this? Second, I cannot remove or edit the macros once the file is saved. The edit and remove tabs are greyed out. Is there a way to remove this macro?

          Thanks..Susan

          • #737667

            What is an “excel edit box”?
            Are you referring to the “macro warning – enable or disable?

            This comes because of the macro.
            if you want to keep this macro you can move it to your personal.xls file and run it from there instead of from this workbook.

            If you have deleted it using tools – macros, the edit will be gone, since there is no macro to edit. The module will remain, you must remove the module the code was in (this is done in VB editor – alt-F11) or you will still get the warning.

            Steve

          • #737668

            What is an “excel edit box”?
            Are you referring to the “macro warning – enable or disable?

            This comes because of the macro.
            if you want to keep this macro you can move it to your personal.xls file and run it from there instead of from this workbook.

            If you have deleted it using tools – macros, the edit will be gone, since there is no macro to edit. The module will remain, you must remove the module the code was in (this is done in VB editor – alt-F11) or you will still get the warning.

            Steve

        • #737653

          Hi Steve: I just had two questions relating to this macro. The first is, now I get an excel edit box every time I open the worksheet. How can I remove this? Second, I cannot remove or edit the macros once the file is saved. The edit and remove tabs are greyed out. Is there a way to remove this macro?

          Thanks..Susan

      • #737596

        Thanks Steve, this worked great…Susan

    • #737580

      Here is a Simple find/replace. You could enhance it to ask for the old and new in an input box if desired.

      Steve

      Sub FixHyperlink()
          Dim wks As Worksheet
          Dim hlink As Hyperlink
          Dim sOld As String
          Dim sNew As String
          
          Set wks = ActiveSheet
          sOld = "OldPath"
          sNew = "NewPath"
      
          For Each hlink In wks.Hyperlinks
              hlink.Address = Application.WorksheetFunction. _
                  Substitute(hlink.Address, sOld, sNew)
          Next hlink
          Set wks = Nothing
      End Sub
    Viewing 1 reply thread
    Reply To: edit hyperlinks (Excel 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: