Put text on clipboard?
"Jos Vens" wrote in message
...
: Hi,
:
: I wonder if you can put some predefined text on the clipboard (not the
: contents of a cell - dashed line) but a text like you should copy in any
: program (and like you can copy a part of text in the formulabar of a whole
: line).
:
: I'd like to paste it back when I'm inputting in a cell when the user needs
: it (ctrl-v works then).
:
: thanks
: Jos Vens
:
Not sure I fully understand, are you looking for something like this?
Sub Macro1()
Dim MyData As DataObject
Set MyData = New DataObject
MyData.SetText "Enter what you want on the clipboard here"
MyData.PutInClipboard
End Sub
In order to run since MyData is earlybind, you must go to tools reference in
the VBA editor and select Microsoft Forms 2.0 Object Library. Or you can
change to late bind (i.e. use CreateObject)
Paul D
|