运行时错误5数学上的无效过程调用或参数

时间:2019-03-29 19:58:34

标签: excel vba

我在gTempConvC =行上得到错误。我认为它是^,但不确定用什么替换它,因为在Excel工作表中看不到它们的用途。这个公式用在工作表中,现在我将其转换为vba

Function gTempConvC(thermistorCnt As Integer, refRCnt As Integer) As Single
Dim CoA As Single
Dim CoB As Single
Dim CoC As Single
Dim CoD As Single
Dim Rth As Single
Dim Kth As Single
    CoA = 0.0009180023
    CoB = 0.0001964561
    CoC = 0.0000007061775
    CoD = 0.00000005283566
    Kth = -273.15 'Constant Degrees Kelvin
        '=((A12*(71500+1000)/B12)-1000) where A12 is thermistorCnt & B12 refRCnt
        Rth = ((thermistorCnt * (71500 + 1000) / refRCnt) - 1000)
        '=(-273.15)+(CoA+CoB*LN(C12)+CoC*LN(C12)^2+CoD*LN(C12)^3)^-1
        gTempConvC = (Kth) + (CoA + CoB * Log(Kth) + CoC * Log(Kth) ^ 2 + CoD * Log(Kth) ^ 3) ^ -1

0 个答案:

没有答案