|
楼主 |
发表于 2010-2-28 23:03
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
原帖由 cflood 于 2010-2-28 22:30 发表
Sub a()
Dim rgn As Range
For i = 1 To Range("K65536").End(xlUp).Row
If Cells(i, 11) = 0 Then
If rgn Is Nothing Then
Set rgn = Cells(i, 1)
Else
Set rgn = Union(rgn, Cells ...
Sub a()
Rows("1:907").Select
Selection.EntireRow.Hidden = False
Range("A1").Select
Dim rgn As Range
For i = 1 To Range("K907").End(xlUp).Row
If Cells(i, 11) = 0 Then
If rgn Is Nothing Then
Set rgn = Cells(i, 1)
Else
Set rgn = Union(rgn, Cells(i, 1))
End If
End If
Next i
If Not rgn Is Nothing Then rgn.EntireRow.Hidden = True
End Sub
我修改了下,为什么后面的不执行了,想不明白啊,因为隐藏后,数据一有变化,就要重新进行隐藏,所以要先取消所有的隐藏后再进行新的隐藏
[ 本帖最后由 lfh760322 于 2010-2-28 23:08 编辑 ] |
|