Sub UpdateLinks()
Dim ws As Worksheet
Dim lastRow As Long
Dim i As Long
' Set reference to the active worksheet
Set ws = ActiveSheet
' Find the last row in column L
lastRow = [Link]([Link], "L").End(xlUp).Row
' Copy column L to column N
[Link]("L2:L" & lastRow).Copy [Link]("N2")
' Replace text in column N
For i = 2 To lastRow
If Not IsEmpty([Link](i, "N")) Then
[Link](i, "N").Value = Replace([Link](i, "N").Value, _
"[Link] _
"[Link]
End If
Next i
' Replace text in column L
For i = 2 To lastRow
If Not IsEmpty([Link](i, "L")) Then
[Link](i, "L").Value = Replace([Link](i, "L").Value, _
"[Link] _
"[Link]
End If
Next i
MsgBox "Links updated successfully!", vbInformation
End Sub