Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I can't figure out why this code takes 9 seconds to run. What it does is
switch the contents of two adjacent cells. It does have to unprotect the worksheet and also turn off autocalculation, then restore both of those settings. But the core code doesn't do much that should generate the delay I am seeing. Any ideas from the experts? TIA With Application .Calculation = xlManual .MaxChange = 0.001 End With ActiveWorkbook.PrecisionAsDisplayed = False ActiveSheet.Unprotect Password:="password" Selection.Cut ActiveCell.Offset(0, -1).Range("A1").Select Selection.Insert Shift:=xlToRight ActiveSheet.Protect Password:="password", DrawingObjects:=True, Contents:=True, Scenarios:=True _ , AllowFiltering:=True With Application .Calculation = xlAutomatic .MaxChange = 0.001 End With ActiveWorkbook.PrecisionAsDisplayed = False |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Slow code when used as VBA code instead of macro (copying visible columns) | Excel Programming | |||
slow code | Excel Programming | |||
Can someone help me with this slow code | Excel Programming | |||
Slow Code | Excel Programming | |||
Is this slow code? | Excel Programming |