clearing the clipboard

J

jasondebolt

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
 
G

Guest

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
 
J

jasondebolt

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

Thanks!
Jason
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top