I have built a UserForm to manage HyperLinks from one worksheet that are related to specific Items on another worksheet.
To support this, I show a UserForm with a listbox containing the Hyperlinks related to the selected item.
The Userform also contains: a button to add a new link, a button to delete a link, and a button to open a link.
I am adding a button to copy a link (to the clipboard). I have built the hyperlink string and copied it to the clipboard.
I could not post the full Sample String here ---> <a href="url">"Test link number 19"</a>
but the "url" is properly formed
I have pasted from the clipboard and the string (as shown above) is returned in both Notepad and Word.
I am not a developer and feel like I am missing something that should be obvious (or I should have learned by now).
Would very much appreciate a push in the right direction.
Code:
Private Sub CopyButton_Click()
Dim CopyToClip As Object
Dim LinkString As String
Set CopyToClip = CreateObject("HtmlFile")
LinkString = "<a href=" & Chr(34) & URLTxtBox & Chr(34) & ">" & Chr(34) & NameTxtBox & Chr(34) & "</a>"
CopyToClip.ParentWindow.ClipboardData.SetData "text", LinkString
End Sub
Bookmarks