excel - VBA CODE RUNTIME ERROR 1004 表示对象定义错误
问题描述
我正在使用 Excel 2007。
我试图在 VBA 中的代码块下方运行,但出现运行时错误 1004,对象定义错误。
代码:
Sub Delete()
If Range("A1") = "" Then
With Sheets("Filter")
Dim ARS As Long
For ARS = .Range("B" & Rows.Count).End(x1up).Row To 5 Step -1
If Right(.Cells(ARS, "B").Value, 3) = "ARS" Then .Rows(ARS).ClearContents
If Right(.Cells(ARS, "B").Value, 3) = "Ars" Then .Rows(ARS).ClearContents
If Right(.Cells(ARS, "B").Value, 3) = "ars" Then .Rows(ARS).ClearContents
Next
End With
End If
end Sub
我的目标是在 ARS 为空的情况下从表中删除 ARS。
对于所有团队 ARS、FUL、LIV 等,我在 Sub Delete 例程中有许多类似的块
有关我的数据,请参阅附件图像。
提前致谢!!
解决方案
推荐阅读
- django - 如何为带有翻译的 django rest 框架模型创建自定义序列化程序
- python - 在二维数组中查找字符串并将它们转换为浮点数 [Python]
- java - ID 生成器比较
- business-objects - Web Intelligence:限制块中的行数
- python - “没有名为 dgl 的模块”,但该模块有效
- dictionary - 使用 Ansible set_fact 从寄存器结果 systemctl 创建字典
- angular - Angular Reactive forms - 来自异步调用的值不更新表单
- node.js - 无法连接到伊蚊 MQTT 代理
- junit - 论据不同!需要:实际调用有不同的参数:
- javascript - Validating React form in componentDidUpdate()