+ Reply to Thread
Results 1 to 10 of 10

Can't paste copied cell

  1. #1
    Registered User
    Join Date
    05-14-2012
    Location
    Alaska, USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Can't paste copied cell

    I think I've done something in vba that messed up my cut/copy capability. I had a bit of code that did the following:

    Copied (actually cut) a table with formulas, inserted without blank rows as values only into a different table while shifting all the rows in that table down.

    This has worked great for quite a while, but then I messed with something else in the sheet and I'm not sure what happened. Now I get a run-time error 1004 when I run the macro, and worse, I can no longer copy or paste.

    This was the code:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The line of code that had the error:

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    When I select a cell and ctl+c or x, the cell has the moving border and the clipboard gets loaded. Then as soon as I select another cell to paste into, the moving border goes away. The data is still on the clipboard though, so I can open the clipboard manually, select the item, and select 'paste'.

    I can open a new worksheet and the copy paste funtion works fine.


    Any ideas?

    Thanks for your help.
    Last edited by Jaron_t; 12-12-2012 at 05:40 PM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Can't paste copied cell

    Did you password protect the worksheet?

    Or try replacing this...
    Rows("107").Select

    ActiveSheet.Paste


    With just this...
    Range("A107").PasteSpecial xlPasteAll

  3. #3
    Registered User
    Join Date
    05-14-2012
    Location
    Alaska, USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Can't paste copied cell

    Ok, that is good. I did that and the macro runs without an error. On the other hand, it also pastes the formulas, and I need the values only and the cell formatting. Also, the copy paste issue is still there.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Can't paste copied cell

    Try this...
    Please Login or Register  to view this content.
    Instaed of ...
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-14-2012
    Location
    Alaska, USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Can't paste copied cell

    Ok. Still got a 1004 error, but it went away when I added an extra line:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    So now the macro seems to work fine. The only problem is that I still can't manually copy a cell and then paste somewhere. As soon as I select another cell the moving border goes away. Actually the fact that I had to add that extra line makes me wonder....it's as if the CutCopyMode is just going away on it's own.

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Can't paste copied cell

    Quote Originally Posted by Jaron_t View Post
    The only problem is that I still can't manually copy a cell and then paste somewhere. As soon as I select another cell the moving border goes away. Actually the fact that I had to add that extra line makes me wonder....it's as if the CutCopyMode is just going away on it's own.
    Do you have an Event macro for the worksheet or workbook? Right-click on the sheet tab and select View Code in the pop-up context menu. Is there any code in the worksheet's code module or in the ThisWorkbook code module?

  7. #7
    Registered User
    Join Date
    05-14-2012
    Location
    Alaska, USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Can't paste copied cell

    Well, I do actually. But I had that before and it all worked together fine. Still, maybe there is something you'll see that I missed. Here's what I have in the worksheet for Event Changes:

    Please Login or Register  to view this content.

  8. #8
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Can't paste copied cell

    This code seems okay as long as you don't select E10:L10 after you copy.

    One thought is the On Error Resume Next line is hiding an error and that error could deselect a copied range.

    As a test, can you comment out all that event macro code and see if you and copy and select another cell. Then if yes, uncomment the code bits one at at time and see which one is causing the problem.

  9. #9
    Registered User
    Join Date
    05-14-2012
    Location
    Alaska, USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Can't paste copied cell

    Well I've got it isolated to change event 3. However when I comment out the On Error Resume Next, it still runs fine...no errors come up. All it does is make an ActiveX button appear/disappear if I click on a cell within a certain range.

  10. #10
    Registered User
    Join Date
    05-14-2012
    Location
    Alaska, USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Can't paste copied cell

    Thanks for your help....At least the macro is running fine. I'm going to keep working on the Change Event3 code like you suggest. If you have any other suggestions let me know.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1