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

后端 未结 1 685
眼角桃花
眼角桃花 2020-12-22 11:42

Can someone please help me understand the problem with this function:

\'the function returns the DISPLAYED color of specified cell
Public Function cellDispla         


        
相关标签:
1条回答
  • 2020-12-22 11:49

    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

    0 讨论(0)
提交回复
热议问题