User Name Active
New Member
- Joined
- Jan 29, 2014
- Messages
- 19
I have a very long code that does exactly what I need it to do, except it takes 25 seconds to run. I have narrowed it down to the following two sections of code that are slowing it down. Can anyone help me on how to make these run faster?
First Section:
Second Section:
First Section:
Code:
lastrow = Sheets("Crew Log").Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Dim rng As Range
For Each rng In Sheets("Crew Log").Range("L2:L" & lastrow)
If rng <> "" Then
Sheets("Storage").Range("A2:K2").Copy Sheets("Crew Log").Cells(rng.Row, 1)
Sheets("Storage").Range("BM2:DQ2").Copy Sheets("Crew Log").Range("BM:DQ").Cells(rng.Row, 1)
End If
Next rng
Second Section:
Code:
Sheets("Summary").Unprotect "password"
With Sheets("Summary")
.Rows(42).Copy .Rows(43).Resize(Sheets("Restructure").Range("G1"))
End With
Application.CutCopyMode = False