Function sumcolor(rng1 As Range, rng2 As Range) As Single*.volatileDim cell As Rangesumcolor = 0For Each cell In rng1If cell.*.color = rng2.***.color Then sumcolor = sumcolor + 1Next cellEnd Function这样就可以了!追问 : Application.Volatile增加了这一句,我试过。把一个单元格的字体设置成红色后,后面调用自定义的函数的公式没变化,但用格式刷刷会变。
Copyright © 2025 IZhiDa.com All Rights Reserved.
知答 版权所有 粤ICP备2023042255号