Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/25.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
XYZ到实验室Excel VB脚本_Excel_Math_Vba - Fatal编程技术网

XYZ到实验室Excel VB脚本

XYZ到实验室Excel VB脚本,excel,math,vba,Excel,Math,Vba,我对下面的VBA宏有一些问题。有人能帮我弄清楚我把事情搞砸了吗 此处引用了计算结果 有两种情况,但最终会出现由最后一种情况决定的错误 If fx_cubed > LAB_EPSILON Then xr = fx_cubed Else: xr = (fx * 116 - 16) / LAB_KAPPA End If If fz_cubed > LAB_EPSILON Then '<~~ xr determined by last condition x

我对下面的VBA宏有一些问题。有人能帮我弄清楚我把事情搞砸了吗

此处引用了计算结果


有两种情况,但最终会出现由最后一种情况决定的错误

If fx_cubed > LAB_EPSILON Then
    xr = fx_cubed
Else:
    xr = (fx * 116 - 16) / LAB_KAPPA
End If

If fz_cubed > LAB_EPSILON Then '<~~ xr determined by last condition 
    xr = f_zcubed
Else:
    xr = (fx * 116 - 16) / LAB_KAPPA
End If
如果fx_cube>LAB_EPSILON那么
xr=fx_立方
其他:
xr=(fx*116-16)/LAB_KAPPA
如果结束

如果fz_cubed>LAB_EPSILON,那么‘具体来说,您有什么问题?您的输入、实际输出和期望输出是什么?此外,如果您将
Option Explicit
放在模块顶部,您将在运行模块时获得很多帮助。您还应在
工具/选项
下选中
要求变量声明
,以便在以后插入模块时自动放置该声明。
If fx_cubed > LAB_EPSILON Then
    xr = fx_cubed
Else:
    xr = (fx * 116 - 16) / LAB_KAPPA
End If

If fz_cubed > LAB_EPSILON Then '<~~ xr determined by last condition 
    xr = f_zcubed
Else:
    xr = (fx * 116 - 16) / LAB_KAPPA
End If