You can use below code to copy a text to clipboard.
Sub CopyToClipboard(strCopy As String)
On Error Resume Next
Dim clipboard As MSForms.DataObject
Dim strSample As String
Set clipboard = New MSForms.DataObject
clipboard.SetText strCopy
clipboard.PutInClipboard
On Error GoTo 0
End Sub
Sub CopyToClipboard(strCopy As String)
On Error Resume Next
Dim clipboard As MSForms.DataObject
Dim strSample As String
Set clipboard = New MSForms.DataObject
clipboard.SetText strCopy
clipboard.PutInClipboard
On Error GoTo 0
End Sub
No comments:
Post a Comment