I can't recall where I pasted it from last year, possibly here, but the macro below used to work sweetly. However it now fails consistently, placing '??' on the clipboard instead of the text in cell B3.
Elsewhere I read this: "There is a known bug in the Dataobject if you are using Windows 8 or later. It is safer to use Windows API calls for copying text from the clipboard."
But, as a VBA novice and non-programmer, I don't know how to do that.
I've done quite a lot of searching and am surprised I've so far not found a simple (reliable) piece of code to do such a commonplace task as copy a cell to the Windows clipboard!
Terry, East Grinstead, UK
Code:
<code>Sub CopyTrackDescrToClipbrd()
' Copies text contents of B3 in active TrackDataSheet to clipboard
' Remains on clipboard after macro finishes
Dim MyData
Set MyData = New DataObject
MyData.SetText Range("B3")
MyData.PutInClipboard
End Sub</code>
Elsewhere I read this: "There is a known bug in the Dataobject if you are using Windows 8 or later. It is safer to use Windows API calls for copying text from the clipboard."
But, as a VBA novice and non-programmer, I don't know how to do that.
I've done quite a lot of searching and am surprised I've so far not found a simple (reliable) piece of code to do such a commonplace task as copy a cell to the Windows clipboard!
Terry, East Grinstead, UK
Last edited: