这个用户定义的函数计算一些值;据此,我需要在调用单元格中返回一个字符串。
函数中的 MsgBox 测试有效,但在单元格中我只收到一个#value!
错误。
为什么?
Function WoodClassify(Length As Double, Girth As Double, Description As String) As Double
Dim cubicMeter As Double
Dim Classification As String
If Length > 250 Then
MsgBox ("TG B(I)")
Classification = "TG B(I)"
ElseIf Length > 100 Then
Classification = "XXXXXXX"
Else
Classification = "WWWWWWWW"
End If
WoodClassify = Classification
End Function