不仅在值更改时刷新VBA功能(还包括颜色等)

问题描述 投票:0回答:1

我试图刷新一个返回一个单元格的colorindex的单元格函数。

Function doubled(RA As Range)

Application.Volatile
doubled = RA.Font.ColorIndex

End Function

我已经看到了这个答案,但是它只更新值:Refresh Excel VBA Function Results

excel vba excel-vba
1个回答
0
投票

@ 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
© www.soinside.com 2019 - 2024. All rights reserved.