View Single Post
 
Old 11-29-2018, 09:25 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

If the aim of the game is to modify a hyperlink (or links) in a pasted text then based on your code.

Code:
Sub Macro134()
Dim oRng As Range
Dim oLink As Hyperlink
    Set oRng = Selection.Range
    oRng.Paste
    Options.AutoFormatReplaceHyperlinks = True
    oRng.AutoFormat
    If oRng.Hyperlinks.Count > 0 Then
        For Each oLink In oRng.Hyperlinks
            oLink.TextToDisplay = Replace(oLink.Address, "https://doi.org/", "doi:")
        Next oLink
    End If
    Set oLink = Nothing
    Set oRng = Nothing
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote