pastespecial

  • Thread starter Thread starter billQ
  • Start date Start date
B

billQ

Hello,
I am pasting data to cells using
Selection.PasteSpecial
Using this I can only paste to another cell once. Using the clipboard
viewer, I noticed that after the first paste the clipboard is cleared,
preventing additional pastes.
Any help will be appreciated.
thanks
bill q
 
thank-you very much
Tom Ogilvy said:
The code that unprotects the sheet causes the clipboard to be cleared for
me. It copied fine, but I couldn't paste even once (xl2000 - recognize you
are using xl2002). If I commented out the protect/unprotect code, it worked
repeatedly for me.

If I ran it like this:

Sub CopyHours()
ActiveCell.Copy
End Sub

Sub PasteHours()
Selection.PasteSpecial Paste:=xlPasteValues
End Sub

Sub setprotect()
ActiveSheet.Protect UserInterfaceOnly:=True
End Sub

It worked fine. I protect the sheet with the UserInterfaceOnly:=true setting
and I didn't need to unprotect in the Pastehours macro - so the clipboard
didn't get cleared. You would need to set this each time the workbook is
opened.


Regards,
Tom Ogilvy
 
Back
Top