如何检查一个单元格是否为空? [英] How to check if a cell is empty?

查看:190
本文介绍了如何检查一个单元格是否为空?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

寻找编码,检查单元格是否为空。如果它不为空,则移动到下一个单元组。但是我需要检查下一个单元格组是否为空。

Looking for coding that checks if cell is empty or not. If it is not empty then move to the next cell group. But I need to check if the next cell group is empty or not. If not, then move to the next and so on.

我的当前编码如下:

If IsEmpty(ActiveSheet.Range("h3")) Then
    Do
    Checkbox1.Value = True
    Range("H3") = 17002
    Sheets("Sheet1").Range("I3") = Printerformat2.Text
Else
    Checkbox1.Value = True
    Range("l3") = 17002
    Sheets("Sheet1").Range("m3") = Printerformat2.Text
End If


推荐答案

我想你应该看看 Range(你的范围)。specialcells(xlCellTypeBlanks)。这是循环通过空单元格的最快方法。

如果需要循环使用非空白单元格,可以检查单元格是否相交空白单元格范围。

I think you should have a look at Range("your range").specialcells(xlCellTypeBlanks). This is the fastest way to loop through empty cells.
If you need to loop on non blank cells, you can check if your cell Intersect the empty cells range.

这篇关于如何检查一个单元格是否为空?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆