我试图刷新一个返回一个单元格的colorindex的单元格函数。
Function doubled(RA As Range)
Application.Volatile
doubled = RA.Font.ColorIndex
End Function
我已经看到了这个答案,但是它只更新值:Refresh Excel VBA Function Results
@ Rory,您是否无法在ThisWorkbook模块中设置worksheet_Change事件,如果更改,该事件将返回颜色索引?
Public doubled as double
Sub Worksheet_Change(target as Range, ws as Worksheet)
If ws = ThisWorkbook.Worksheets("your_worksheet") and target = Range("your_range") And _
target.font.colorIndex <> RGB(the, original, color) then
double = target.font.colorIndex
end if