Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Navin Gada   on Jan 05 In MS Office Category.

  
Question Answered By: Gerardo Morgan   on Jan 05

I can track down the problem  caused by
extensive recalculation whenever a sheet  is deleted.

Therefore, I have to turn off the automatic recalculation and turn it
on again  at the end.

Sub DeleteOld()

Application.Calculation = xlCalculationManual

For Each Sheet In Worksheets

If IsDate(Sheet.Name) Then
If DateValue(Sheet.Name) <= DateValue(Date - 14) Then
Application.DisplayAlerts = False
Sheet.Delete
End If

End If
Next

Application.Calculation = xlCalculationAutomatic

End Sub

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Delete Sheet Problem, Excel Crash ! Or get search suggestion and latest updates.


Tagged: