作业帮 > 综合 > 作业

excel中VBA函数 log10()

来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/07/01 05:12:31
excel中VBA函数 log10()
Cells(3,k + 2).Value = Cells(6,19) * Power((Cells(3,k) + 273) * (Log10(Cells(3,30)) + Cells(2,23)) / 1000,2) + Cells(6,20) * Power((Cells(3,k) + 273) * (Log10(Cells(3,30)) + Cells(2,23)) / 1000,1) + Cells(6,21) '将这个单元格的应力σ算出来
编辑器为什么说Log10()没有定义而报错,难道VBA中没有Log10()这个函数吗?
那么vba中Log10(),即以10为底的对数函数,该怎么写了?
excel中VBA函数 log10()
LOG10是工作表函数,在VBA中要使用工作表函数,必须通过 WorksheetFunction 对象:
Cells(3, k + 2).Value = Cells(6, 19) * Power((Cells(3, k) + 273) * (WorksheetFunction.Log10(Cells(3, 30)) + Cells(2, 23)) / 1000, 2) + Cells(6, 20) * Power((Cells(3, k) + 273) * (WorksheetFunction.Log10(Cells(3, 30)) + Cells(2, 23)) / 1000, 1) + Cells(6, 21)