There might be a lot of factors contributing to this issue:
Any actions triggered in these events:
Worksheet_Calculate()
Worksheet_Change()
Worksheet_FollowHyperlink()
Worksheet_SelectionChange()
Workbook_SheetCalculate()
Workbook_SheetChange()
Workbook_SheetFollowHyperlink()
external links, and the external file(s) moved or deleted
database connections (check Data Tab -> Connections) (doubtful)
Invalid Named Ranges (Formula Tab -> Name Manager; any Refs?)
Data validation rules (Data Tab -> Data Validation -> clear all)
Are you opening the file from a network location - this will make it
much slower
Conditional Formatting rules? - remove all
Any hidden objects? (Alt + F10 - delete all)
Hidden formatting (what is the last used cell with data?)
Corrupt file
If the file is corrupt, and it's feasible, try re-creating it from scratch, and run this function first
- If it's not corrupt, one of the first things I'd try is to disable
all Excel
functionality before the macro:
Sub MainSubTryMe()
'UnlockSettingsWorksheet
FastWB '<--- Disables all Application and Worksheet level settings
'YOURCODE HERE
XlResetSettings '<--- Restores all Excel settings to defaults
'LockSettingsWorksheet
End Sub
Public Sub FastWB(Optional ByVal opt As Boolean = True)
With Application
.Calculation = IIf(opt, xlCalculationManual, xlCalculationAutomatic)
.DisplayAlerts = Not opt
.DisplayStatusBar = Not opt
.EnableAnimations = Not opt
.EnableEvents = Not opt
.ScreenUpdating = Not opt
End With
FastWS , opt
End Sub
Public Sub FastWS(Optional ByVal ws As Worksheet, Optional ByVal opt As Boolean = True)
If ws Is Nothing Then
For Each ws In Application.ThisWorkbook.Sheets
OptimiseWS ws, opt
Next
Else
OptimiseWS ws, opt
End If
End Sub
Public Sub OptimiseWS(ByVal ws As Worksheet, ByVal opt As Boolean)
With ws
.DisplayPageBreaks = False
.EnableCalculation = Not opt
.EnableFormatConditionsCalculation = Not opt
.EnablePivotTable = Not opt
End With
End Sub
Public Sub XlResetSettings() 'default Excel settings
With Application
.Calculation = xlCalculationAutomatic
.DisplayAlerts = True
.DisplayStatusBar = True
.EnableAnimations = False
.EnableEvents = True
.ScreenUpdating = True
Dim ws As Worksheet
For Each ws In Application.ThisWorkbook.Sheets
With ws
.DisplayPageBreaks = False
.EnableCalculation = True
.EnableFormatConditionsCalculation = True
.EnablePivotTable = True
End With
Next
End With
End Sub
Maybe this will eliminate some VBA causes
You Can also Have a look here :
Improving calculation performance
Performance and limit improvements
Tips for optimizing performance obstructions
An other Stack Answer