Comment to clipboard

Paul B

Well-known Member
Joined
Feb 15, 2002
Messages
577
Need a macro to get the comment, if there is one, from the active cell and put the text in the clipboard, is this possible? This will be used with Excel 2003. Thanks
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Don't know what clipboard you want to use - Excel or Windows.
This will put the comment on Excel Clipboard.
VBA Code:
Sub CommentToExcelClipboard()
Dim T As String
If Not ActiveCell.Comment Is Nothing Then
    T = ActiveCell.Comment.Text
    With Cells(1, Columns.Count)
        .Value = T
        .Copy
        'Comment is now on the Excel clipboard. Next line enters it in
        'cell M1 - change to suit
        Range("M1").PasteSpecial xlPasteValues 'test it - remove or change to suit
        .ClearContents
    End With
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,980
Messages
6,122,563
Members
449,088
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top