简体   繁体   English

Excel公式不会自动更新

[英]Excel formula do not update automatically

I have created a simple excel formula to know what is the color of the font of the cell A1 我创建了一个简单的excel公式,以了解单元格A1的字体是什么颜色

Function GetFontColorIndex(elrango As Range) As Integer
        Application.Volatile
       GetFontColorIndex = elrango.Cells(1, 1).Font.ColorIndex
End Function

In :
File > Options > Formulas > Workbook Calculation > Automatic is checked 选中文件>选项>公式>工作簿计算>自动

In cell A1 I have a number, and in cell A3 I have 在单元格A1我有一个数字,在单元格A3我有一个
=GetFontColorIndex(A1)

but when I change the font of cell A1 , the formula does not update automatically on cell A3 . 但是当我更改单元格A1的字体时,该公式不会在单元格A3上自动更新。 I have to click shift+F9 and then it works. 我必须单击shift+F9 ,然后它才能工作。

Any idea why is not showing the number of the font automatically? 知道为什么不自动显示字体编号吗?

As simoco has mentioned. 正如simoco所提到的。

If you are using your 'udf' in Sheet1 then in the module associated with that sheet add the following: 如果要在Sheet1中使用“ udf”,请在与该表关联的模块中添加以下内容:

在此处输入图片说明

If you just change the colour the formula does not update but as soon as you press enter or select another cell in the sheet it updates 如果您只是更改颜色,则公式不会更新,但只要按Enter键或在工作表中选择另一个单元格,它就会更新

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM