excel - VBA Sumproduct 返回#value!on cell - 如何修复我的代码以避免此错误?
问题描述
我有一个工作簿,其中有大约 80 个其他工作簿的链接。加载速度真的很慢。我决定停止使用链接来加快速度。这意味着找到一种方法来使用 VBA sumproduct 来执行一些计算。我现在很头疼,因为我得到了#Value!我的 VBA 代码中的错误。
option explicit
Sub VBA_Sumproduct
Dim rng_1 as range
Dim op_cell as range
Dim Model as String
Dim formula as string
Dim wb as workbook
dim wb2 as workbook
set wb2 = workbooks("wb2.xlsm")
'workbooks.open("Filepath")
set wb = workbooks("wb1.xlsm")
set rng_1=wb.sheets("A1").range("E2:E500")
set op_cell = wb2.sheets("T1").range("E20")
model = "Complete"
Formula = "sumproduct((rng_1="" & model & "")"
op_cell = application.evaluate(Formula)
wb.save
wb.close
end sub
解决方案
推荐阅读
- database - 关系模式到 ER 图/基数差异
- reactjs - how to display records in a dropdown using react redux
- c# - 从 C# 中的外部进程弹出 DLL
- lets-encrypt - AKS 的 cert-manager 的 helm chart 安装超时
- python - yum 源码中没有用的 if 语句
- android - RecyclerAdapter 正在背靠背创建多个视图
- java - Spring - 处理请求参数中的空值
- c# - 如何获取不同情况的特定子字符串
- ios - 使用 `inputAccessoryView` 时显示的警告
- swift - 使用 Alamofire swift 4 上传文件