如何在Excel中瞬间刷新计算

刷新单元格的计算时遇到问题。

换句话说,我有很多专栏,我在其中每一个都有一个公式或macros。

但问题是,我应该绝对激活选项“自动计算”的Excel选项或我应该保存然后出现新的结果。

现在,我会在macros中插入一些可以瞬间刷新结果的东西。

谢谢

你可以简单地按下:

F9来计算整个活动工作簿

Shift + F9来计算活动工作表


无论如何,这里是与.Calculate的不同选项:

 Sub Souma() 'Use this to calculate all the open workbooks Application.Calculate 'Use this to calculate the whole sheet, called "Sheet1" ThisWorkbook.Worksheets("Sheet1").Calculate 'Use this to calculate the cell A1 on the sheet called "Sheet1" ThisWorkbook.Worksheets("Sheet1").Range("A1").Calculate 'Use this to calculate the range A1 to D10 on the sheet called "Sheet1" ThisWorkbook.Worksheets("Sheet1").Range("A1:D10").Calculate 'Use this to calculate the column A on the sheet called "Sheet1" ThisWorkbook.Worksheets("Sheet1").Columns(1).Calculate 'Use this to calculate the row 1 on the sheet called "Sheet1" ThisWorkbook.Worksheets("Sheet1").Rows(1).Calculate End Sub 

将以下代码复制并粘贴到您的VBA项目中:

 Private Sub Workbook_Open() Application.Calculation = xlCalculationAutomatic End Sub 

打开Excel文件后,该代码应该自动运行,在所有打开的文件中启用自动计算。