我在Excel VBA中创建了以下功能:
Function GetBTM(bai As Integer, comment As String, amt As Double)
If (bai = 195) Then
GetBTM = "Customer Wires"
End If
If (bai = 399 And Application.WorksheetFunction.Find("MOV TIT", comment) > 0) Then
GetBTM = "Customer Wires"
End If
End Function
当我在电子表格中使用该功能时,只有第二个if语句有效,第一个语句会产生#value。我相信我的sytax是正确的,所以我不确定我哪里出错了。
由于
答案 0 :(得分:1)
这对你有帮助吗?
Public Function GetBTM(bai As Integer, comment As String, amt As Double)
If (bai = 195) Then
GetBTM = "Customer Wires"
ElseIf (bai = 399 And Application.WorksheetFunction.Find("MOV TIT", comment) > 0) Then
GetBTM = "Customer Wires"
End If
End Function