Advertisement
Guest User

Untitled

a guest
May 2nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Dim hypLink As Hyperlink
  2. Dim x As Long
  3. Dim Numrows As Long
  4.  
  5. ' Set numrows = number of rows of data.
  6. Numrows = Range("D2", Range("D2").End(xlDown)).Rows.Count
  7. ' Establish "For" loop to loop "numrows" number of times.
  8. For x = 2 To Numrows
  9. If Cells(x,3).Hyperlinks.Count > 0 Then
  10. If Left(Cells(x,3)..Hyperlinks(1).Address, 43) <> "\\us.mycompany.net\dutfolder1\DATA\dut\newfolder" And Left(Cells(x,3)..Hyperlinks(1).Address, 34) = "\\us.mycompany.net\dutfolder1\DATA\dut" Then
  11. Cells(x,3).Hyperlinks(1).Address = Replace(Cells(x,3).Hyperlinks(1).Address, "\\us.mycompany.net\dutfolder1\DATA\dut", "\\us.mycompany.net\dutfolder1\DATA\dut\newfolder")
  12. End If
  13. End If
  14.  
  15. Next x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement