Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Set variable to clipboard contents?
Is it possible to set a variable to the contents of the clipboard? That is,
what is the VBA equivalent of MyVar = Ctrl-V? -- Thanks, Fred |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Set variable to clipboard contents?
look up GetFromClipboard Method. Copies data from the Clipboard to a
DataObject. Your variable has to be a DataObject. You ca transfer from that to other variable types. "Fred Smith" wrote in message ... Is it possible to set a variable to the contents of the clipboard? That is, what is the VBA equivalent of MyVar = Ctrl-V? -- Thanks, Fred |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Set variable to clipboard contents?
Fred.
First, set a reference to the MSForms library (in VBA, Tools menu, then References), and use code like the following: Dim DataObj As New MSForms.DataObject Dim S As String DataObj.GetFromClipboard S = DataObj.GetText Debug.Print S See also www.cpearson.com/excel/clipboar.htm . -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Fred Smith" wrote in message ... Is it possible to set a variable to the contents of the clipboard? That is, what is the VBA equivalent of MyVar = Ctrl-V? -- Thanks, Fred |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do I keep clipboard contents active in excel? | Excel Discussion (Misc queries) | |||
Clear clipboard contents | Excel Discussion (Misc queries) | |||
Paste contents of windows clipboard into a vba 2d array? | Excel Programming | |||
Dump of all variable contents | Excel Programming | |||
Clipboard contents | Excel Programming |