Do you ever think or need to clear/empty Clipboard Excel?
I have a big Excel file which abusing the power of copy and paste to format the data and formula. I prefer to update the formula once, then save the result as values, especially for lookup formula. If I am not doing this, each time I am changing something, it will trigger the lookup formula and make the Excel freeze a few minutes.
The down side of the approach, after several hours, Excel will become slower and slower. It’s look like after extensive abuse of copy and paste, the memory will full of data and slower the Excel application.
Fortunately, after applying empty clipboard Excel using VBA macro, the Excel application keep running smoothly until the end of the day.
There are two ways to clear Excel clipboard using VBA.
1. Empty Clipboard Excel Using Excel Application properties
Application.CopyObjectsWithCells = False
2. Empty Clipboard Excel Using Windows Empty Clipboard function
Public Declare Function OpenClipboard Lib "user32" ( _
ByVal NewOwner As Long) As Boolean
Public Declare Function EmptyClipboard Lib "user32" () As Boolean
Public Declare Function CloseClipboard Lib "user32" () As Boolean
Sub ClearClipboard()
' call ClearClipboard() from your other VBA macro to clear/empty Windows Clipboard
If OpenClipboard(0) Then
EmptyClipboard
CloseClipboard
End If
End Sub
Both approach will empty the Clipboard, but the first approach will only empty copied data from Excel cells, both values and format. It will not empty Clipboard for any data that belong to application. Using Windows Empty Clipboard function, it will empty Clipboard regardless who is the owner of those data.
Just call one of the two functions above inside your macro, before or after you perform any extensive copy and paste macro to clear your Clipboard. For the 2nd approach, you need to put it in one of your VBA modules first.
Do you have another method to clear/empty Excel Clipboard? Please leave your comments below. Thanks.

Excel Extract Cell Comments
Excel VBA/Macro example below will extract comment from every cells with comment, and put the summary in the cell selected by user using Excel input box (read more about how to get cell reference using input box here).
Sub CreateCommentsSummary() Dim rgComments As Range, rgCell As Range, rgOutput As Range, iRow As Integer, iCol As Integer ' get all cells with comment Set rgComments = ActiveSheet.Cells.SpecialCells(xlCellTypeComments) ' get cell reference where user want to place the summary Set rgOutput = _ Application.InputBox(Prompt:="Select cell where you want to put the comments summary", _ Title:="Comments Summary", Type:=8) iRow = rgOutput.Row iCol = rgOutput.Column ' read each cell with comment and build the summary For Each rgCell In rgComments Cells(iRow, iCol) = rgCell.Address ' print cell address Cells(iRow, iCol + 1) = rgCell.Value ' print cell value Cells(iRow, iCol + 2) = rgCell.Comment.Text 'print cell comment text iRow = iRow + 1 Next rgCell End SubHappy coding