mattloflin
MIS
Hey guys I have a macro that reads a sheet then rearranges it and then reformats it. However it takes probably 2 to 3 minutes to run. This is with just Columns i'd say A -> O and about 250 lines.
Here is the code that takes the longest time:
Sheets("Build Sheet").Range("A2:A" & newLastRow).Value = Sheets("PreProcess Doc").Range("B2:B" & newLastRow).Value
Sheets("Build Sheet").Range("B2:B" & newLastRow).Value = Sheets("PreProcess Doc").Range("R2:R" & newLastRow).Value
Sheets("Build Sheet").Range("C2:C" & newLastRow).Value = Sheets("PreProcess Doc").Range("W2:W" & newLastRow).Value
Sheets("Build Sheet").Range("D2" & newLastRow).Value = Sheets("PreProcess Doc").Range("T2:T" & newLastRow).Value
Sheets("Build Sheet").Range("E2:E" & newLastRow).Value = Sheets("PreProcess Doc").Range("U2:U" & newLastRow).Value
Sheets("Build Sheet").Range("F2:F" & newLastRow).Value = Sheets("PreProcess Doc").Range("V2:V" & newLastRow).Value
Sheets("Build Sheet").Range("G2:G" & newLastRow).Value = Sheets("PreProcess Doc").Range("D2" & newLastRow).Value
Sheets("Build Sheet").Range("H2:H" & newLastRow).Value = Sheets("PreProcess Doc").Range("M2:M" & newLastRow).Value
Sheets("Build Sheet").Range("I2:I" & newLastRow).Value = Sheets("PreProcess Doc").Range("J2:J" & newLastRow).Value
Sheets("Build Sheet").Range("J2:J" & newLastRow).Value = Sheets("PreProcess Doc").Range("N2:N" & newLastRow).Value
Sheets("Build Sheet").Range("K2:K" & newLastRow).Value = Sheets("PreProcess Doc").Range("K2:K" & newLastRow).Value
Sheets("Build Sheet").Range("L2:L" & newLastRow).Value = Sheets("PreProcess Doc").Range("P2" & newLastRow).Value
Sheets("Build Sheet").Range("M2:M" & newLastRow).Value = Sheets("PreProcess Doc").Range("G2:G" & newLastRow).Value
it reads from one sheet and puts it on another by using ranges.
Is there anyway to speed this process us?
Also once it redoes everything it says "Calculating" in the bottom left is this necessary? If asked i'll try to upload a copy of the macro or the code. Just trying to get the ball rolling
Here is the code that takes the longest time:
Sheets("Build Sheet").Range("A2:A" & newLastRow).Value = Sheets("PreProcess Doc").Range("B2:B" & newLastRow).Value
Sheets("Build Sheet").Range("B2:B" & newLastRow).Value = Sheets("PreProcess Doc").Range("R2:R" & newLastRow).Value
Sheets("Build Sheet").Range("C2:C" & newLastRow).Value = Sheets("PreProcess Doc").Range("W2:W" & newLastRow).Value
Sheets("Build Sheet").Range("D2" & newLastRow).Value = Sheets("PreProcess Doc").Range("T2:T" & newLastRow).Value
Sheets("Build Sheet").Range("E2:E" & newLastRow).Value = Sheets("PreProcess Doc").Range("U2:U" & newLastRow).Value
Sheets("Build Sheet").Range("F2:F" & newLastRow).Value = Sheets("PreProcess Doc").Range("V2:V" & newLastRow).Value
Sheets("Build Sheet").Range("G2:G" & newLastRow).Value = Sheets("PreProcess Doc").Range("D2" & newLastRow).Value
Sheets("Build Sheet").Range("H2:H" & newLastRow).Value = Sheets("PreProcess Doc").Range("M2:M" & newLastRow).Value
Sheets("Build Sheet").Range("I2:I" & newLastRow).Value = Sheets("PreProcess Doc").Range("J2:J" & newLastRow).Value
Sheets("Build Sheet").Range("J2:J" & newLastRow).Value = Sheets("PreProcess Doc").Range("N2:N" & newLastRow).Value
Sheets("Build Sheet").Range("K2:K" & newLastRow).Value = Sheets("PreProcess Doc").Range("K2:K" & newLastRow).Value
Sheets("Build Sheet").Range("L2:L" & newLastRow).Value = Sheets("PreProcess Doc").Range("P2" & newLastRow).Value
Sheets("Build Sheet").Range("M2:M" & newLastRow).Value = Sheets("PreProcess Doc").Range("G2:G" & newLastRow).Value
it reads from one sheet and puts it on another by using ranges.
Is there anyway to speed this process us?
Also once it redoes everything it says "Calculating" in the bottom left is this necessary? If asked i'll try to upload a copy of the macro or the code. Just trying to get the ball rolling