确定某范围内给定单元格的显示/隐藏状态
我有一组值作为范围设置,并希望为其中的每一个运行给定的操作。 这工作:
Sub demo() For Each listitem in Sheets("Sheet").Range("List").Rows 'Do stuff with listitem Next listitem End Sub
问题是,我想添加一些额外的function; 如果我隐藏一个给定的行,我希望它能够接受,而不是处理那一行 – 这些行:
Sub demo() For Each listitem in Sheets("Sheet").Range("List").Rows If listitem.Visible Then 'Do stuff with listitem End If Next listitem End Sub
不幸的是,当我尝试的时候,我总是得到Object does not support this property or method
。
大概这是可能的,那么我需要使用什么命令才能使其工作?
我认为If listitem.Hidden=False
可以工作。