I have been working with this code for a while, it leaves only the url in the selected area, removing what is unnecessary, it works correctly but only for one url, if more than one url appears in one cell it will leave only the first one, additionally if the url is linked to another it will interpret it as one url, and the idea is to separate them. I tried modifying the code or using ideas from other scripts, but it didn't work for me. The main thing is to leave only the url in the selected area, each on a new line.
Public Function ExtractURL(ByVal InputVal As String) As String
Dim StartPos As Long
StartPos = InStr(1, InputVal, "http")
If StartPos > 0 Then
Dim EndPos As Long
EndPos = InStr(StartPos + 1, InputVal, """")
If EndPos > 0 Then
ExtractURL = Mid$(InputVal, StartPos, EndPos - StartPos)
End If
End If
End Function
Sub url_change_cell_select()
Dim RetVal As String
Dim cell As Range
For Each cell In Selection.Cells
RetVal = ExtractURL(cell.Value)
If RetVal <> vbNullString Then
cell.Value = RetVal
End If
Next cell
Load KOD
KOD.Show
End Sub
