Thanks for all the help, much appreciated.
Final code that solved my problem:
Sub Open_SelectedTextlinks()
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim x
If Target.Count = 1 Then
If Not Intersect(Target, Range("B2:B1000")) Is Nothing Then
x = GetNum(Target(, 0))
If (x <> "") * (Target.Hyperlinks.Count = 0) Then Me.Hyperlinks.Add Target, "https://google.com/100" & x
End If
End If
End Sub
Function GetNum(ByVal txt As String) As String
With CreateObject("VBScript.RegExp")
.Pattern = "\d+(?=(\-|$))"
If .test(txt) Then GetNum = .Execute(txt)(0)
End With
End Function
Bookmarks