Clear Clipboard after Copy/Paste

  • Thread starter Thread starter Yan He
  • Start date Start date
Joined
5/6/06
Messages
384
Points
28
Does anyone has the VBA code for delete or cear the Clipboad after copy/paste. I tried the
Application.CutCopyMode = False
Doesn't work for me :(

I googled...couldn't find :sos:

Thanks,
 
You can't clear the Office clipboard with that vba code. It works for another kind of clipboard.
I'm not entirely sure you can clear it via vba. The simplest solution would be to disable it altogether.
 
Are you doing copy/paste in VBA? The code you cited has worked for me when I've done it.

The alternative would be to name the range you want to copy and set a destination range equal to it. Speeding Up Slow Excel VBA Code. Efficient VBA Code/Macros .

Or, perhaps you could do your copy/paste and then copy a blank range. A little lame, but it might work.

Andy, you never cease to amaze me. I didn't know there were two "clipboards."
 
Thanks, Andy and Charlesdwright!
That piece of code works for me finally, after adjusting my codes a little bit.
 
BTW, I am looking for a function code with input: say, a random date (20080714)
output: the nth week of the month. (3rd week in July here)

Anyone has any ideas? thanks,
 
Cell A1 contains the date
Here is the formula in another cell
=ROUNDUP((DAY(A1)+WEEKDAY(DATE(YEAR(A1),MONTH(A1),0)))/7,0)
This assumes Sunday is first day of the week (which is how Excel calendar works).
 
Thank you so much, Andy.

But when I try 6/30/2008...or any other month end...it turns out to be 6!! It's won't work...:(
 
Back
Top Bottom