Copy and paste is very slow VBA

  • hi,


    i am using this code to copy data and paste at other workbook,
    but it is very slow.
    need help


  • Re: Copy and paste is very slow VBA


    Try this and see if it is any faster. It may not be, but give it a shot. I haven't tested it because I don't have a workbook set up the same way, but something similar worked on one of my workbooks.


  • Re: Copy and paste is very slow VBA


    Not working? Well good luck to you friend. How about something like: Thanks for trying, when I ran it this is what I saw and compared to my original here is the performance.


    Try to remember you came here for help.

  • Re: Copy and paste is very slow VBA


    Try this.


    Your code is slow because it switches between the 2 workbooks 6 times as well as copy/pasting 6 times. This code will place the values to be transferred into 6 arrays, then put those arrays onto the other workbook, no copy/pasting and only 1 workbook switch.


    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

  • Re: Copy and paste is very slow VBA


    giving an error 438
    object doesn't supoort property
    at below line

    Code
    [COLOR=#333333].Cells(.Rows.Count, 4).End(xlUp).Offset(1).Resize([/COLOR][COLOR=blue]UBound[/COLOR][COLOR=#333333](x1, 1)) = x1[/COLOR]
  • Re: Copy and paste is very slow VBA


    Sorry wrote that code on the fly and forgot to specify the sheet in the 2nd workbook, try this version.


    You will need to change the sheet name in the code if it is not named "Sheet1"


    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

  • Re: Copy and paste is very slow VBA


    @KjBox
    THANX A LOT


    I CHANGED THESE ONES


    Code
    [/I][COLOR=#417394]        End With[/COLOR][COLOR=#417394]        Exit Sub[/COLOR][COLOR=#417394]End With[/COLOR][COLOR=#417394]End If[/COLOR][COLOR=#417394]End Sub[/COLOR][I]


    NOW ITS WORKING PERFECTLY AS I WANTED[/I]

  • Re: Copy and paste is very slow VBA


    KjBox
    in below code i am having same problem, will u look plz this one here or i start a new thread?


  • Re: Copy and paste is very slow VBA


    Since this is a different question referring to a different, even though similar, issue it should be asked in a new thread.

    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!