copy-paste entire row to another sheet (need faster way)

1

Is there a faster way to copy an entire row from Sheets("S") to Sheets("Database")? "S" has formulas/source. "Database" has only values/destination. My code is as follows, but takes too long:

Sub CopyPasteRow()

        Sheets("S").Rows("8:8").Copy
        With Sheets("Database").Rows(r & ":" & r)
          .PasteSpecial xlPasteValues
          .PasteSpecial xlPasteFormats
        Application.CutCopyMode = False
        End With

End Sub

SofiaEd

Posted 2019-04-29T19:46:39.860

Reputation: 187

Try adding Application.ScreenUpdating = False at the beginning of your macro (and turn it back to True at the end) – cybernetic.nomad – 2019-04-29T20:00:29.917

1How long does it take? I used it to copy 14500 cells with different formats and formulas, and paste it on 50 rows at the same time. Took less than a second. – Christofer Weber – 2019-04-29T20:06:50.457

2Also no idea where that r variable comes from, but it should probably be declared or at least set to something at some point. – Christofer Weber – 2019-04-29T20:15:08.120

Thank you everyone! It took 2 seconds for the full macro, and I have to do this 700 times -- 700 x 2 = 1,400 seconds (or 23 minutes), too long! The variable "r" is the row found in the database of 700 rows. Already turned off screenupdating, etc, Hmmm...... No faster way, guys? – SofiaEd – 2019-04-30T05:23:04.967

No answers