Trying to copy one row tens of thousands of times - my code is rubbish!

TheWennerWoman

Active Member
Joined
Aug 1, 2019
Messages
270
Office Version
  1. 365
Platform
  1. Windows
Code:
Sub test()
With Worksheets("element_bf")
    Dim lr As Long: lr = .Cells(Rows.Count, 1).End(xlUp).Row + 1
End With
Worksheets("element_rec").Range("A2:EO2").Cells.Copy
For a = lr To 3 Step -1
With Worksheets("element_rec")
        .Cells(lr, 1).PasteSpecial xlAll
        lr = lr - 1
End With
Next a
End Sub

Can anyone improve on this, this is taking forever and I know it's due to my poor coding!

Many thanks!

EDIT: these are formulae
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
How about
VBA Code:
With Worksheets("element_bf")
    Dim lr As Long: lr = .Cells(Rows.Count, 1).End(xlUp).Row + 1
End With
Worksheets("element_rec").Range("A2:EO2").Resize(lr - 1).FillDown
End Sub
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,011
Messages
6,122,677
Members
449,092
Latest member
tayo4dgacorbanget

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top