Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy to clipboard
This should be easy.
I want to select a cell. then copy the comment from a cell into the clipboard. To get the comment I can Excel.Selection.Comment.Text for copying to the clipboard. Googline I see a clipboard object. people use: Clipboard.setText but clipboard is not an object for me. Do you have to add a reference in? dim it as something? thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy to clipboard
If you don't already have a userform, add one and then you can delete it
(just a quick way to add the necessary Reference for DataObject). Sub ComToClipBrd() Dim sComText As String Dim dtaObj As DataObject On Error Resume Next sComText = ActiveCell.Comment.Text On Error GoTo 0 If Len(sComText) Then Set dtaObj = New DataObject dtaObj.SetText sComText dtaObj.PutInClipboard MsgBox sComText, , "put in clipboard" End If End Sub Regards, Peter T "greg" wrote in message ... This should be easy. I want to select a cell. then copy the comment from a cell into the clipboard. To get the comment I can Excel.Selection.Comment.Text for copying to the clipboard. Googline I see a clipboard object. people use: Clipboard.setText but clipboard is not an object for me. Do you have to add a reference in? dim it as something? thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy to clipboard
thanks
works great "Peter T" <peter_t@discussions wrote in message ... If you don't already have a userform, add one and then you can delete it (just a quick way to add the necessary Reference for DataObject). Sub ComToClipBrd() Dim sComText As String Dim dtaObj As DataObject On Error Resume Next sComText = ActiveCell.Comment.Text On Error GoTo 0 If Len(sComText) Then Set dtaObj = New DataObject dtaObj.SetText sComText dtaObj.PutInClipboard MsgBox sComText, , "put in clipboard" End If End Sub Regards, Peter T "greg" wrote in message ... This should be easy. I want to select a cell. then copy the comment from a cell into the clipboard. To get the comment I can Excel.Selection.Comment.Text for copying to the clipboard. Googline I see a clipboard object. people use: Clipboard.setText but clipboard is not an object for me. Do you have to add a reference in? dim it as something? thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
clipboard copy & paste | Excel Discussion (Misc queries) | |||
Transfer clipboard from Task pane clipboard(office?) content to Excel (windows?) clipboard? | Excel Programming | |||
copy to the clipboard and into another workbook | Excel Discussion (Misc queries) | |||
Copy from clipboard? | Excel Programming | |||
Copy to windows clipboard | Excel Programming |