小编hk9*_*6fh的帖子

VBA代码返回#value错误

我正在尝试显示excel中条件格式的颜色.在excel中我只使用= CheckColour(B5),当我点击返回时它可以工作.但是,当我要求工作表计算时,函数给出#VALUE!而且我不知道我哪里出错了.任何帮助都表示赞赏,因为我是VBA的初学者.谢谢

    Function CheckColour(range)
        If range.DisplayFormat.Interior.Color = RGB(255, 0, 0) Then
        CheckColour = "Red"
        ElseIf range.DisplayFormat.Interior.Color = RGB(0, 130, 59) Then
        CheckColour = "Green"
        Else
        CheckColour = "Amber"
        End If
    End Function
Run Code Online (Sandbox Code Playgroud)

excel vba excel-vba

1
推荐指数
1
解决办法
223
查看次数

标签 统计

excel ×1

excel-vba ×1

vba ×1