Clipboard go empty when unprotecting sheet !!

  • Thread starter Thread starter Imbecill
  • Start date Start date
I

Imbecill

Hello,

My problem is that in my code I unprotect the sheet and furter down the sub,
I try to pastespecial. However, the clipboard go empty when
ActiveSheet.Unprotect come...

I can't "paste first" or in an other way change order, because the
pastespecial is generated by a Application.OnKey "^v", "FormulaPaste"
and the Sheet.Unprotect is inside an event witin another macro that starts
when you activate the sheet.

Any solution? Ive searched everywere ...
 
Imbecill,

CutCopyMode gets turned off my many things when the clipboard contains an
Excel object. To see this, try doing a manual copy, then select a cell,
enter something, and press Enter. Clipboard cleared. When the clipboard
contains other stuff, like text or a graphic, this doesn't happen

You can step through your code with F8, Alt-Tabbing back to Excel to see
where the marching ants around the copied area go away. That's where it
happened. I think you'll have to change your code around and go copy the
stuff just before you want to paste it. The usual construct to do it all at
once is:

Range(MyRange).Copy Destination:=Range("E5")
 

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

Back
Top