none
Strange Paste Activity! RRS feed

  • Question

  • HI

    Got a small VB process that based on a specific bit of text in a colum, will insert a couple of row and past some into in the new "Gap".

    The code I have always used before was

    Worksheets("LIit").Range("M2:U4").Copy _
                  rngFound.Offset(1, 3).EntireRow

    This always just inserted the details in M2:U4 into A : E- I then have a loop to go down the list and repeat.

    However just noticed that on some spreadsheets if I copy a range of cells, then highlight a row- sometimes it only pastes the 5 columns I have, but then sometimes post the same info multiple times all the way across the spread sheet!

    Anyone any idea whats going on?

    Thanks

    David

    Monday, April 24, 2017 2:11 PM

All replies

  • Hi David_1234,

    you had mentioned that,"However just noticed that on some spreadsheets if I copy a range of cells, then highlight a row- sometimes it only pastes the 5 columns I have, but then sometimes post the same info multiple times all the way across the spread sheet!"

    I can see that you just post the one line of code that doing copy and paste.

    I suggest you to post the full code. so that we can look in to the code and try to test it on our side.

    below are some general suggestions that can cause this issue.

    (1) it is possible that you are using some loops and call this line inside loop. so it executes multiple times and paste the value on sheet multiple times.

    (2) you call the same line or method multiple times in your code by mistakenly and you are not aware about that.

    (3) you have some events that get executed when the value of sheet or value of cell gets changed.

    and in that event you have the same code. so whenever cell value get changed it fires the event and it creates a chain reaction that cause this issue.

    (4) something get corrupted in your workbook that cause this issue.

    These are some general suggestions that you can try to check at your side.

    you can post your code / workbook with dummy data here and we can try to make a further tests with that to resolve the issue.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, April 27, 2017 2:22 AM
    Moderator
  • Hi David_1234,

    I can see that after posting the thread, you did not done any follow up on this thread.

    is your issue is solved now?

    if it is solved then please try to update the status of this thread and mark it as an answer.

    so that we can close this thread. the thread is still open.

    if your issue is still exist then let me know about that, we will again try to provide you further help to solve your issue.

    Regards

    Deepak 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 22, 2017 9:05 AM
    Moderator