我不知道为什么这段代码不起作用。
Function colorme(Red As Integer, Green As Integer, Blue As Integer)
Application.Caller.Interior.color = RGB(Red, Green, Blue)
End Function
我想让它在电子表格中工作,如:
__red__|_green_|_blue__|_color_|_
____50_|_____0_|____60_|#purple|_
但#purple实际上是紫色的,使用colorme(A2,B2,C2)。
答案 0 :(得分:0)
除了包含公式的单元格的值之外,用户定义的函数不能更改单元格的任何属性。您可以编写一个子程序来更改单元格的颜色,但除非我弄错了,否则您尝试的方式是不可能的。