Speeding this Macro Up

scrum33200

New Member
Joined
Aug 4, 2011
Messages
1
I'm not very good with macros. In fact until last monday I had never created one. But now i have a macro that takes forever to run. I'm sure it can be sped up with loops, but its over my head. Can some one help. thanks




Sub multiply()
'
'
'
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
'
Columns("B:G").Select
Selection.insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove

Range("A1").Select

Dim rw, LastRow, inRows, numRows As Double
'Find last row with data in Column A/ insert paperstock/ insert vendor
LastRow = Range("A" & Rows.Count).End(xlUp).Row
Cells(LastRow, "G").Value = "=Home!D33"
Cells(LastRow + 1, "G").Value = "=Home!D33"
Cells(LastRow + 2, "G").Value = "=Home!D33"
Cells(LastRow + 3, "G").Value = "=Home!D33"
Cells(LastRow + 4, "G").Value = "=Home!D33"
Cells(LastRow + 5, "G").Value = "=Home!D33"
Cells(LastRow + 6, "G").Value = "=Home!D33"
Cells(LastRow + 7, "G").Value = "=Home!D33"
Cells(LastRow + 8, "G").Value = "=Home!D33"
Cells(LastRow + 9, "G").Value = "=Home!D33"
Cells(LastRow + 10, "G").Value = "=Home!E33"
Cells(LastRow + 11, "G").Value = "=Home!E33"
Cells(LastRow + 12, "G").Value = "=Home!E33"
Cells(LastRow + 13, "G").Value = "=Home!E33"
Cells(LastRow + 14, "G").Value = "=Home!E33"
Cells(LastRow + 15, "G").Value = "=Home!E33"
Cells(LastRow + 16, "G").Value = "=Home!E33"
Cells(LastRow + 17, "G").Value = "=Home!E33"
Cells(LastRow + 18, "G").Value = "=Home!E33"
Cells(LastRow + 19, "G").Value = "=Home!E33"
Cells(LastRow + 20, "G").Value = "=Home!E33"
Cells(LastRow + 21, "G").Value = "=Home!E33"
Cells(LastRow + 22, "G").Value = "=Home!F33"
Cells(LastRow + 23, "G").Value = "=Home!F33"
Cells(LastRow + 24, "G").Value = "=Home!F33"
Cells(LastRow + 25, "G").Value = "=Home!F33"
Cells(LastRow + 26, "G").Value = "=Home!F33"
Cells(LastRow + 27, "G").Value = "=Home!F33"
Cells(LastRow + 28, "G").Value = "=Home!F33"
Cells(LastRow + 29, "G").Value = "=Home!F33"
Cells(LastRow + 30, "G").Value = "=Home!F33"
Cells(LastRow + 31, "G").Value = "=Home!F33"
Cells(LastRow + 32, "G").Value = "=Home!F33"
Cells(LastRow + 33, "G").Value = "=Home!G33"
Cells(LastRow + 34, "G").Value = "=Home!G33"
Cells(LastRow + 35, "G").Value = "=Home!G33"
Cells(LastRow + 36, "G").Value = "=Home!G33"
Cells(LastRow + 37, "G").Value = "=Home!G33"
Cells(LastRow + 38, "G").Value = "=Home!G33"
Cells(LastRow + 39, "G").Value = "=Home!G33"
Cells(LastRow + 40, "G").Value = "=Home!G33"
Cells(LastRow + 41, "G").Value = "=Home!G33"
Cells(LastRow + 42, "G").Value = "=Home!G33"
Cells(LastRow + 43, "G").Value = "=Home!G33"
Cells(LastRow + 44, "G").Value = "=Home!H33"
Cells(LastRow + 45, "G").Value = "=Home!H33"
Cells(LastRow + 46, "G").Value = "=Home!H33"
Cells(LastRow + 47, "G").Value = "=Home!H33"
Cells(LastRow + 48, "G").Value = "=Home!H33"
Cells(LastRow + 49, "G").Value = "=Home!H33"
Cells(LastRow + 50, "G").Value = "=Home!H33"
Cells(LastRow + 51, "G").Value = "=Home!H33"
Cells(LastRow + 52, "G").Value = "=Home!H33"
Cells(LastRow + 53, "G").Value = "=Home!H33"
Cells(LastRow + 54, "G").Value = "=Home!H33"

Cells(LastRow, "F").Value = "=Home!I33"
Cells(LastRow + 1, "F").Value = "=Home!J33"
Cells(LastRow + 2, "F").Value = "=Home!K33"
Cells(LastRow + 3, "F").Value = "=Home!L33"
Cells(LastRow + 4, "F").Value = "=Home!M33"
Cells(LastRow + 5, "F").Value = "=Home!N33"
Cells(LastRow + 6, "F").Value = "=Home!O33"
Cells(LastRow + 7, "F").Value = "=Home!P33"
Cells(LastRow + 8, "F").Value = "=Home!Q33"
Cells(LastRow + 9, "F").Value = "=Home!R33"
Cells(LastRow + 10, "F").Value = "=Home!S33"
Cells(LastRow + 11, "F").Value = "=Home!I33"
Cells(LastRow + 12, "F").Value = "=Home!J33"
Cells(LastRow + 13, "F").Value = "=Home!K33"
Cells(LastRow + 14, "F").Value = "=Home!L33"
Cells(LastRow + 15, "F").Value = "=Home!M33"
Cells(LastRow + 16, "F").Value = "=Home!N33"
Cells(LastRow + 17, "F").Value = "=Home!O33"
Cells(LastRow + 18, "F").Value = "=Home!P33"
Cells(LastRow + 19, "F").Value = "=Home!Q33"
Cells(LastRow + 20, "F").Value = "=Home!R33"
Cells(LastRow + 21, "F").Value = "=Home!S33"
Cells(LastRow + 22, "F").Value = "=Home!I33"
Cells(LastRow + 23, "F").Value = "=Home!J33"
Cells(LastRow + 24, "F").Value = "=Home!K33"
Cells(LastRow + 25, "F").Value = "=Home!L33"
Cells(LastRow + 26, "F").Value = "=Home!M33"
Cells(LastRow + 27, "F").Value = "=Home!N33"
Cells(LastRow + 28, "F").Value = "=Home!O33"
Cells(LastRow + 29, "F").Value = "=Home!P33"
Cells(LastRow + 30, "F").Value = "=Home!Q33"
Cells(LastRow + 31, "F").Value = "=Home!R33"
Cells(LastRow + 32, "F").Value = "=Home!S33"
Cells(LastRow + 33, "F").Value = "=Home!I33"
Cells(LastRow + 34, "F").Value = "=Home!J33"
Cells(LastRow + 35, "F").Value = "=Home!K33"
Cells(LastRow + 36, "F").Value = "=Home!L33"
Cells(LastRow + 37, "F").Value = "=Home!M33"
Cells(LastRow + 38, "F").Value = "=Home!N33"
Cells(LastRow + 39, "F").Value = "=Home!O33"
Cells(LastRow + 40, "F").Value = "=Home!P33"
Cells(LastRow + 41, "F").Value = "=Home!Q33"
Cells(LastRow + 42, "F").Value = "=Home!R33"
Cells(LastRow + 43, "F").Value = "=Home!S33"
Cells(LastRow + 44, "F").Value = "=Home!I33"
Cells(LastRow + 45, "F").Value = "=Home!J33"
Cells(LastRow + 46, "F").Value = "=Home!K33"
Cells(LastRow + 47, "F").Value = "=Home!L33"
Cells(LastRow + 48, "F").Value = "=Home!M33"
Cells(LastRow + 49, "F").Value = "=Home!N33"
Cells(LastRow + 50, "F").Value = "=Home!O33"
Cells(LastRow + 51, "F").Value = "=Home!P33"
Cells(LastRow + 52, "F").Value = "=Home!Q33"
Cells(LastRow + 53, "F").Value = "=Home!R33"
Cells(LastRow + 54, "F").Value = "=Home!S33"

'Loop through data, inserting rows
For rw = LastRow To 3 Step -1
For inRows = 1 To 54
Rows(rw).insert Shift:=xlDown
Next

ActiveCell(rw - 1, "G").Value = "=Home!D33"
ActiveCell(rw, "G").Value = "=Home!D33"
ActiveCell(rw + 1, "G").Value = "=Home!D33"
ActiveCell(rw + 2, "G").Value = "=Home!D33"
ActiveCell(rw + 3, "G").Value = "=Home!D33"
ActiveCell(rw + 4, "G").Value = "=Home!D33"
ActiveCell(rw + 5, "G").Value = "=Home!D33"
ActiveCell(rw + 6, "G").Value = "=Home!D33"
ActiveCell(rw + 7, "G").Value = "=Home!D33"
ActiveCell(rw + 8, "G").Value = "=Home!D33"
ActiveCell(rw + 9, "G").Value = "=Home!D33"
ActiveCell(rw + 10, "G").Value = "=Home!E33"
ActiveCell(rw + 11, "G").Value = "=Home!E33"
ActiveCell(rw + 12, "G").Value = "=Home!E33"
ActiveCell(rw + 13, "G").Value = "=Home!E33"
ActiveCell(rw + 14, "G").Value = "=Home!E33"
ActiveCell(rw + 15, "G").Value = "=Home!E33"
ActiveCell(rw + 16, "G").Value = "=Home!E33"
ActiveCell(rw + 17, "G").Value = "=Home!E33"
ActiveCell(rw + 18, "G").Value = "=Home!E33"
ActiveCell(rw + 19, "G").Value = "=Home!E33"
ActiveCell(rw + 20, "G").Value = "=Home!E33"
ActiveCell(rw + 21, "G").Value = "=Home!F33"
ActiveCell(rw + 22, "G").Value = "=Home!F33"
ActiveCell(rw + 23, "G").Value = "=Home!F33"
ActiveCell(rw + 24, "G").Value = "=Home!F33"
ActiveCell(rw + 25, "G").Value = "=Home!F33"
ActiveCell(rw + 26, "G").Value = "=Home!F33"
ActiveCell(rw + 27, "G").Value = "=Home!F33"
ActiveCell(rw + 28, "G").Value = "=Home!F33"
ActiveCell(rw + 29, "G").Value = "=Home!F33"
ActiveCell(rw + 30, "G").Value = "=Home!F33"
ActiveCell(rw + 31, "G").Value = "=Home!F33"
ActiveCell(rw + 32, "G").Value = "=Home!G33"
ActiveCell(rw + 33, "G").Value = "=Home!G33"
ActiveCell(rw + 34, "G").Value = "=Home!G33"
ActiveCell(rw + 35, "G").Value = "=Home!G33"
ActiveCell(rw + 36, "G").Value = "=Home!G33"
ActiveCell(rw + 37, "G").Value = "=Home!G33"
ActiveCell(rw + 38, "G").Value = "=Home!G33"
ActiveCell(rw + 39, "G").Value = "=Home!G33"
ActiveCell(rw + 40, "G").Value = "=Home!G33"
ActiveCell(rw + 41, "G").Value = "=Home!G33"
ActiveCell(rw + 42, "G").Value = "=Home!G33"
ActiveCell(rw + 43, "G").Value = "=Home!H33"
ActiveCell(rw + 44, "G").Value = "=Home!H33"
ActiveCell(rw + 45, "G").Value = "=Home!H33"
ActiveCell(rw + 46, "G").Value = "=Home!H33"
ActiveCell(rw + 47, "G").Value = "=Home!H33"
ActiveCell(rw + 48, "G").Value = "=Home!H33"
ActiveCell(rw + 49, "G").Value = "=Home!H33"
ActiveCell(rw + 50, "G").Value = "=Home!H33"
ActiveCell(rw + 51, "G").Value = "=Home!H33"
ActiveCell(rw + 52, "G").Value = "=Home!H33"
ActiveCell(rw + 53, "G").Value = "=Home!H33"

Cells(rw - 1, "F").Value = "=Home!I33"
Cells(rw + 0, "F").Value = "=Home!J33"
Cells(rw + 1, "F").Value = "=Home!K33"
Cells(rw + 2, "F").Value = "=Home!L33"
Cells(rw + 3, "F").Value = "=Home!M33"
Cells(rw + 4, "F").Value = "=Home!N33"
Cells(rw + 5, "F").Value = "=Home!O33"
Cells(rw + 6, "F").Value = "=Home!P33"
Cells(rw + 7, "F").Value = "=Home!Q33"
Cells(rw + 8, "F").Value = "=Home!R33"
Cells(rw + 9, "F").Value = "=Home!S33"
Cells(rw + 10, "F").Value = "=Home!I33"
Cells(rw + 11, "F").Value = "=Home!J33"
Cells(rw + 12, "F").Value = "=Home!K33"
Cells(rw + 13, "F").Value = "=Home!L33"
Cells(rw + 14, "F").Value = "=Home!M33"
Cells(rw + 15, "F").Value = "=Home!N33"
Cells(rw + 16, "F").Value = "=Home!O33"
Cells(rw + 17, "F").Value = "=Home!P33"
Cells(rw + 18, "F").Value = "=Home!Q33"
Cells(rw + 19, "F").Value = "=Home!R33"
Cells(rw + 20, "F").Value = "=Home!S33"
Cells(rw + 21, "F").Value = "=Home!I33"
Cells(rw + 22, "F").Value = "=Home!J33"
Cells(rw + 23, "F").Value = "=Home!K33"
Cells(rw + 24, "F").Value = "=Home!L33"
Cells(rw + 25, "F").Value = "=Home!M33"
Cells(rw + 26, "F").Value = "=Home!N33"
Cells(rw + 27, "F").Value = "=Home!O33"
Cells(rw + 28, "F").Value = "=Home!P33"
Cells(rw + 29, "F").Value = "=Home!Q33"
Cells(rw + 30, "F").Value = "=Home!R33"
Cells(rw + 31, "F").Value = "=Home!S33"
Cells(rw + 32, "F").Value = "=Home!I33"
Cells(rw + 33, "F").Value = "=Home!J33"
Cells(rw + 34, "F").Value = "=Home!K33"
Cells(rw + 35, "F").Value = "=Home!K33"
Cells(rw + 36, "F").Value = "=Home!M33"
Cells(rw + 37, "F").Value = "=Home!N33"
Cells(rw + 38, "F").Value = "=Home!O33"
Cells(rw + 39, "F").Value = "=Home!P33"
Cells(rw + 40, "F").Value = "=Home!Q33"
Cells(rw + 41, "F").Value = "=Home!R33"
Cells(rw + 42, "F").Value = "=Home!S33"
Cells(rw + 43, "F").Value = "=Home!I33"
Cells(rw + 44, "F").Value = "=Home!J33"
Cells(rw + 45, "F").Value = "=Home!K33"
Cells(rw + 46, "F").Value = "=Home!L33"
Cells(rw + 47, "F").Value = "=Home!M33"
Cells(rw + 48, "F").Value = "=Home!N33"
Cells(rw + 49, "F").Value = "=Home!O33"
Cells(rw + 50, "F").Value = "=Home!P33"
Cells(rw + 51, "F").Value = "=Home!Q33"
Cells(rw + 52, "F").Value = "=Home!R33"
Cells(rw + 53, "F").Value = "=Home!S33"

Next rw

Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic

End Sub
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Forum statistics

Threads
1,224,514
Messages
6,179,225
Members
452,896
Latest member
IGT

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