我正在尝试构建一个基于字符串比较使用特定公式的函数
我遇到的问题是我得到一个Byref 争论类型不匹配错误
它必须与传递字符串进行比较以及公式的数字有关。有人可以帮忙看看吗?
Public Function MyRateCalc(rateType As String, fixedAmount As Long, minAmount As Long, rateDollar As Long, valPerc As Long, rtValue As Long) As Double
Select Case rateType
Case "A1"
MyRateCalc = fixedAmount * valPerc
Case "A"
MyRateCalc = rtValue * rateDollar * valPerc
Case "B", "C", "D", "H", "L", "N", "R"
MyRateCalc = IIf(rtValue * rateDollar > minAmount, rtValue * rateDollar * valPerc, minAmount * valPerc)
Case "M", "U", "MS"
MyRateCalc = rtValue * rateDollar * valPerc
Case Else
MyRateCalc = 0
End Select
End Function