Randy Downs
asked on
Excel 2013 VBA very slow on some PCs
We have an Excel VBA macro that takes 9 minutes to complete on one PC while most run the macro in about 30 seconds. I can get to this section of the macro in the problem PC in about 19 seconds but executing the .Clear takes over 2 minutes.
Note that this macro is a carryover from 2001 and we've had to modify it to run on the newer versions of Excel. All Computers are using Excel 2013 but the version varies slightly (15.0.4753.1000 vs. 15.0.4745.1000)
Local variables:
sze = 238
Note that this macro is a carryover from 2001 and we've had to modify it to run on the newer versions of Excel. All Computers are using Excel 2013 but the version varies slightly (15.0.4753.1000 vs. 15.0.4745.1000)
' Clear error flags
[A1].Select
Range(Cells(2, 1), Cells(sze, 1)).Clear
Local variables:
sze = 238
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That seems to have fixed it. What;s the difference in .Clear & .ClearContents ?
Clear removes in-cell formulae/values and formatting.
ClearContents just removes the formulae/values.
ClearContents just removes the formulae/values.
ASKER
OK, I think we can live without the formatting being cleared. Thanks for the speedy advice
ASKER
works great for my application. No idea why Clear takes so long when ClearContents zip right on.
ASKER