excel - 忽略使用“与”的 IF 语句中的空白单元格
问题描述
我目前有以下脚本来搜索 4 个单元格值。它会删除所有包含大于 10 的值的所有行。但是,我正在努力添加一个嵌套的“IF”语句来忽略空格。
Sub test()
For i = Cells(Rows.Count, "A").End(xlUp).Row To 2 Step -1
If Cells(i, "C").Value2 >= 10 And Cells(i, "D").Value2 >= 10 And Cells(i, "E").Value2 >= 10 And Cells(i, "F").Value2 >= 10 Then
Rows(i).Delete
End If
Next i
End Sub
解决方案
子测试()
Range("C:F" & LastRow).Replace "", "999", xlWhole
For i = Cells(Rows.Count, "A").End(xlUp).Row To 2 Step -1
If Cells(i, "C").Value2 >= 10 And Cells(i, "D").Value2 >= 10 And Cells(i, "E").Value2 >= 10 And Cells(i, "F").Value2 >= 10 Then
Rows(i).Delete
End If
Next i
Range("C:F" & LastRow).Replace "999", "", xlWhole
End Sub
推荐阅读
- arrays - 将 Pytorch 的张量元素转换为“float”类型而不是“double”类型
- java - 基于GSON中字段名的同类型序列化,无注解
- python - ffpyplayer ImportError:导入播放器时DLL加载失败
- django - 在 django 中获取与选定外键相关的项目
- java - Java Spring 规范嵌套连接条件
- amazon-web-services - VPC 终端节点无法连接到共享 AWS 账户中的 S3
- python - 基于键将字典值组合在一起
- ios - 使用 BlueSocket 框架通过 TCP 发送的不完整图像
- interface - gfortan 模糊接口的问题
- javascript - 具有自定义(动态)条件的 fizzbuzz 问题