Function CreateURL(Text) Set regEx = New RegExp With regEx .IgnoreCase = True .Global = True .Pattern = "\[url=((http|https|ftp)\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}?/?[a-zA-Z0-9\-\._\?\,\`/\\\+&%\$#\=~]*)\](\s*[a-zA-Z]+((.|\n)*?)\s*)\[\/url\]" End With Set objEx = regEx.Execute(Text) For Each x In objEx Text = Replace(Text,x,""& Trim(x.SubMatches(2)) &"", 1,-1,1) Next CreateURL = Text End Function