Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This portion of my macro is running pretty slow. All it does is copy row 1
(with its formatting & formulas) enough times so that there will be a row for each person in the company. We're only talking less than 500 people. Any ideas to speed this process up? I thought about starting out with 300 rows pre-populated (instead of 1) so my For loop could start at 300...in this economy I'd hate to assume they will always have a minimum of 300 employees, but if that's what it takes to speed this up, I'll do it. Many thanks!! ' Disable some features to speed up processing With Application .ScreenUpdating = False .Calculation = xlCalculationManual End With ' Add row for each employee to be imported pct = 0 ctr = 1 imax = i For i = i To 1 Step -1 Rows(1).Copy Rows(13).Insert Shift:=xlDown Rows(13).RowHeight = 12.75 Range("A13").Select ctr = ctr + 1 pct = ctr / imax * 100 Application.StatusBar = "Importing census..." & pct & "% Complete" Next i Application.StatusBar = False -- Please remember to indicate when the post is answered so others can benefit from it later. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Unless I missed something, this should do what you want pretty quick. Just
adjust the receiving range for as many rows as you need. I only made it 88 for demo purposes. Sub copyToMultRws() Rows(1).Copy Range("A13:A100") End Sub "KC Rippstein" wrote: This portion of my macro is running pretty slow. All it does is copy row 1 (with its formatting & formulas) enough times so that there will be a row for each person in the company. We're only talking less than 500 people. Any ideas to speed this process up? I thought about starting out with 300 rows pre-populated (instead of 1) so my For loop could start at 300...in this economy I'd hate to assume they will always have a minimum of 300 employees, but if that's what it takes to speed this up, I'll do it. Many thanks!! ' Disable some features to speed up processing With Application .ScreenUpdating = False .Calculation = xlCalculationManual End With ' Add row for each employee to be imported pct = 0 ctr = 1 imax = i For i = i To 1 Step -1 Rows(1).Copy Rows(13).Insert Shift:=xlDown Rows(13).RowHeight = 12.75 Range("A13").Select ctr = ctr + 1 pct = ctr / imax * 100 Application.StatusBar = "Importing census..." & pct & "% Complete" Next i Application.StatusBar = False -- Please remember to indicate when the post is answered so others can benefit from it later. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Extremely slow response times in Excel 2007 | Excel Discussion (Misc queries) | |||
Fast code in 2003 = agonizingly slow code in 2007 | Excel Programming | |||
Slow code when used as VBA code instead of macro (copying visible columns) | Excel Programming | |||
Slow in program after running few times | Excel Programming | |||
Slow Code | Excel Programming |