ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   clearing the clipboard (https://www.excelbanter.com/excel-discussion-misc-queries/140108-clearing-clipboard.html)

[email protected]

clearing the clipboard
 
Does anyone know of a macro that will clear the clipboard? I'm copying
stuff from the web into a spreadsheet and would like to use a macro
instead of the "clear all" button on the clipboard.

The following script doesn't seem to be working:

Application.CutCopyMode = False

Thanks!
Jason


Greg Wilson

clearing the clipboard
 
Try:

Declare Function EmptyClipboard Lib "user32" () As Long
Private Declare Function CloseClipboard Lib "user32" () As Long
Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As
Long

Sub ClearClip()
OpenClipboard 0&
EmptyClipboard
CloseClipboard
End Sub

" wrote:

Does anyone know of a macro that will clear the clipboard? I'm copying
stuff from the web into a spreadsheet and would like to use a macro
instead of the "clear all" button on the clipboard.

The following script doesn't seem to be working:

Application.CutCopyMode = False

Thanks!
Jason



[email protected]

clearing the clipboard
 
I ran the macro and nothing seems to happen. Can I just copy and paste
this code into a VBA module?

Thanks!
Jason



On Apr 23, 7:52 pm, Greg Wilson
wrote:
Try:

Declare Function EmptyClipboard Lib "user32" () As Long
Private Declare Function CloseClipboard Lib "user32" () As Long
Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As
Long

Sub ClearClip()
OpenClipboard 0&
EmptyClipboard
CloseClipboard
End Sub

" wrote:
Does anyone know of a macro that will clear the clipboard? I'm copying
stuff from the web into a spreadsheet and would like to use a macro
instead of the "clear all" button on the clipboard.


The following script doesn't seem to be working:


Application.CutCopyMode = False


Thanks!
Jason





All times are GMT +1. The time now is 10:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com