User defined worksheet function returns #VALUE! error instead of cell color index

偶尔善良 提交于 2019-11-29 17:58:29
Gareth

After checking on msdn, it appears you cannot use .DisplayFormat in UDF's:

Note that the DisplayFormat property does not work in user defined functions. For example, in a worksheet function that returns the interior color of a cell, you use a line similar to:
Range(n).DisplayFormat.Interior.ColorIndex. When the worksheet function executes, it returns a #VALUE! error.

http://msdn.microsoft.com/en-us/library/office/ff838814(v=office.15).aspx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!