LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
ron ron is offline
external usenet poster
 
Posts: 118
Default Check if clipboard is empty before pasting

On Feb 3, 12:28*pm, Munchkin
wrote:
I want my macro button to paste what is in the clipboard onto my excel
document, but if the clipboard is empty I want a message to pop up that
states "Your clipboard is empty - retry copying your data." and end the macro.

If there is something in the clipboard it should proceed with pasting it. *
I've tried several things but non of them are working.

* * Cells.Select
* * ActiveSheet.Paste


Try something like the following...Ron

' test to see if the clipboard is empty
If Application.ClipboardFormats(1) = -1 Then
MsgBox "Your clipboard is empty - retry copying your data."
End
Else
Cells.Select
ActiveSheet.Paste
End If
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clipboard empty but still get waring that clipboard is full Steve Excel Discussion (Misc queries) 0 June 17th 08 09:05 PM
Clipboard empty but get cannot empty CB when trying to copy Peter @ ServiceMaster Excel Worksheet Functions 0 February 22nd 07 03:58 PM
Pasting clipboard to Excel sheet Ray S. Excel Programming 6 February 13th 07 05:28 PM
Check if clipboard is empty before .PasteSpecial xlPasteValues Spaan Excel Programming 2 August 23rd 04 03:13 PM
Macro - Pasting clipboard in a find box Mike Tomasura Excel Programming 2 July 16th 03 04:23 PM


All times are GMT +1. The time now is 02:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"