Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel 代码中的类型错误_Excel_Vba - Fatal编程技术网

Excel 代码中的类型错误

Excel 代码中的类型错误,excel,vba,Excel,Vba,将Z和LT定义为长 ActiveCell.FormulaR1C1 = "=NORMSINV(RC[-1])" Z = ActiveCell.Value ActiveCell.Formula = _ "=VLOOKUP($B$1,Sheet3!$A$74:$D$97,4,FALSE)" LT = ActiveCell.Value ActiveCell.FormulaR1C1 = "=" + Z + "*RC[-2]*SQRT(" + LT + ")" 这一行给出了类型

将Z和LT定义为长

ActiveCell.FormulaR1C1 = "=NORMSINV(RC[-1])"    
Z = ActiveCell.Value

ActiveCell.Formula = _
        "=VLOOKUP($B$1,Sheet3!$A$74:$D$97,4,FALSE)"

LT = ActiveCell.Value
ActiveCell.FormulaR1C1 = "=" + Z + "*RC[-2]*SQRT(" + LT + ")"

这一行给出了类型错误

您需要用替换“+”&这就是串联在VBA中的工作方式

嘿,您还可以帮助我使用实数的数据类型吗