Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 11-05-2022, 05:15 AM
gmayor's Avatar
gmayor gmayor is offline Make hyperlink in macro using Clipboard Windows 10 Make hyperlink in macro using Clipboard Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,138
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 ofgmayor has much to be proud of
Default

Put the cursor in the first line of the link text and run the following to hyperlink that text.

Code:
Sub Macro1()
Dim oRng As Range
Dim sLink As String
    Selection.HomeKey
    Set oRng = Selection.Range
    oRng.MoveEndUntil Chr(11)
    sLink = oRng.Text
    oRng.Hyperlinks.Add oRng, sLink
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
 

Tags
getfromclipboard, hyperlink, macro error



Similar Threads
Thread Thread Starter Forum Replies Last Post
Make hyperlink in macro using Clipboard Copy Specific Text String To Clipboard At End Of Macro et_33 Excel Programming 8 10-11-2022 06:24 AM
WORD MACRO COPY/PAST from clipboard rachidlea Word VBA 0 11-16-2021 09:38 AM
Macro for copying in clipboard more than one selected text ghostwhisperer86 Outlook 0 03-31-2019 07:47 AM
Make hyperlink in macro using Clipboard How to extract selected hyperlink address to clipboard? poetofpiano Word VBA 8 02-18-2018 07:17 PM
Add Hyperlink in Visio that when clicked copies something to your clipboard MoHyB Visio 0 11-10-2017 08:55 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:44 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft