none
Paste special not working in VBA RRS feed

  • Question

  • Hi,

    Below code worked OK

            .Cells(sel_row, i).Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False

    But after putting following statement before it :

        oldStatusBar = Application.DisplayStatusBar
        Application.DisplayStatusBar = True
        Application.StatusBar = "Please be patient..."
        Application.ScreenUpdating = False

    I receive an error 1004  .... paste special failed

    Can somebody help?



    Tuesday, August 8, 2017 8:50 AM

Answers

  • Hi, 

    I'm afraid the code you've provided is not full.
    Please provide more complete code related to PasteSpecial.

    Regards, 

    Ashidacchi

    • Marked as answer by shaka_rastafar Saturday, September 16, 2017 6:26 PM
    Tuesday, August 8, 2017 9:11 AM

All replies

  • Hi, 

    I'm afraid the code you've provided is not full.
    Please provide more complete code related to PasteSpecial.

    Regards, 

    Ashidacchi

    • Marked as answer by shaka_rastafar Saturday, September 16, 2017 6:26 PM
    Tuesday, August 8, 2017 9:11 AM
  • Hi shaka_rastafar,

    I try to make a test on my side with the code below.

    Sub demo()
        Dim oldStatusBar As Boolean
        oldStatusBar = Application.DisplayStatusBar
         Application.DisplayStatusBar = True
         Application.StatusBar = "Please be patient..."
         Application.ScreenUpdating = False
         
         
         With Worksheets("Sheet1")
            .Range("A1:A1").Copy
            .Range("B1:B1").PasteSpecial _
             Operation:=xlPasteSpecialOperationNone
         End With
        Application.ScreenUpdating = True
    
    End Sub

    I call this sub on button click.

    on my side it is working correctly.

    it looks like there is some mistake in your code.

    you can try to check your whole code. the code posted by you is working on my side.

    make sure that you are coping the value and then trying to paste.

    for more information regarding Paste special you can refer links below.

    Range.PasteSpecial Method (Excel)

    if you still have issue then you can try to again post it. we will again try to test it and inform you about the result.

    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.

    Wednesday, August 9, 2017 1:58 AM
    Moderator
  • Hi shaka_rastafar,

    I can see that you did not visit this thread after posting the issue.

    is your issue solved?

    if yes, I suggest you to mark the appropriate suggestions as an answer. it will help us to close this thread. this thread is still active.

    if you got the solution by yourself then post the solution and mark it as an answer.

    if your issue is still exist then refer the suggestions on this thread.

    if still you have further questions then let us know about that.

    we will try to provide further suggestions to solve 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, August 17, 2017 9:21 AM
    Moderator