Worksheets("Sheet1").UsedRange.Calculate is not working when calculations are set to Manual in Excel VBA - Sta

I have a number of spreadsheets written with VBA code in the background that that rely on iterative cal

I have a number of spreadsheets written with VBA code in the background that that rely on iterative calculations until a solution is found. These worked fine up until around the 11th of February 2025. Since then the Worksheets("Sheet1").UsedRange.Calculate has not been working. I have to set the workbook up to Application.Calculation = xlManual, otherwise some of my calculations can become unstable. I have then been cascading the calculations across the sheets in a specific order to allow the data to flow through.

In simple terms my problem is that if I open a new workbook and for example set cell A1 to =B1 and cell B1 to =A1+1. This should increment the values every time I recalculate the sheet. Indeed if I F9 it does. However, when the workbook is set to: Application.Calculation = xlManual, though F9 still works Worksheets("Sheet1").UsedRange.Calculate does not. Please see my test code below including comments.

Sub TestCalculate()
Worksheets("Sheet1").UsedRange.Calculate 'Now only works when Automatic Calculations are enabled.`  
'Application.Calculate 'Works fine with or without Automatic Calculation enabled but calculates the whole workbook which is not what I need.`
End Sub

I feel like this maybe linked to an Office 365 update as I cannot understand why else it would stop working but am reluctant to roll back the version and have this problem reappear later. Any help would be greatly appreciated. Many Thanks

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744786511a4593660.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信