Akashwani
Well-known Member
- Joined
- Mar 14, 2009
- Messages
- 2,911
Hi,
I'm using the following code and it takes over 20 seconds to complete what I thought was a simple process
The workbook is 616kb it contains 2 tables, 6 charts, hundreds of Sumproduct formulas and a few dozen Index/Match.
Why is this so slow? I have run the code with Application.Calculation commented out and it takes about 1m 10s
Any suggestions on how to speed things up? This workbook is going to grow massively once it starts to be used daily and I cannot have the user waiting 22 seconds now let alone what it may take in 6 months time.
Thanks
Ak
I'm using the following code and it takes over 20 seconds to complete what I thought was a simple process
Code:
Sub CopyDeleteData()
Dim t As Date
t = Now()
Application.ScreenUpdating = False
Application.Calculation = xlManual
ActiveSheet.Unprotect ("Password1")
With ActiveSheet
lRow = .Cells(Rows.Count, 1).End(xlUp).Row + 1
.Cells(lRow, 1).Value = Range("I4")
.Cells(lRow, 2).Value = Range("J4")
.Cells(lRow, 3).Value = Range("K4")
.Cells(lRow, 4).Value = Range("L4")
'.Cells(lRow, 5).Value = ActiveSheet.Range("F11")
End With
Range("I4:L4").Select
Selection.ClearContents
Range("I4").Select
ActiveSheet.Protect ("Password1")
Application.ScreenUpdating = True
Application.Calculation = xlAutomatic
MsgBox Format(Now() - t, "hh:mm:ss")
End Sub
The workbook is 616kb it contains 2 tables, 6 charts, hundreds of Sumproduct formulas and a few dozen Index/Match.
Why is this so slow? I have run the code with Application.Calculation commented out and it takes about 1m 10s
Any suggestions on how to speed things up? This workbook is going to grow massively once it starts to be used daily and I cannot have the user waiting 22 seconds now let alone what it may take in 6 months time.
Thanks
Ak