User defined worksheet function returns #VALUE! error instead of cell color index
问题 Can someone please help me understand the problem with this function: 'the function returns the DISPLAYED color of specified cell Public Function cellDisplayCol(ByRef c As Range) As Long cellDisplayCol = c.DisplayFormat.Interior.ColorIndex End Function Sub test() MsgBox cellDisplayCol(ActiveCell) End Sub the test works as expected but when I use the function in worksheet cell: =cellDisplayCol(A1) it returns #VALUE! error... Any ideas why? What should I fix? Many thanks! 回答1: After checking on