การซ่อนคอลัมภน์
Posted: Sat Dec 17, 2011 8:30 am
Code: Select all
Sub HideRows()
Dim cell As Range
Dim AllCell As Range
With Sheets("Sheet1")
Set AllCell = .Range("A1", .Range( _
"A" & Rows.Count).End(xlUp))
End With
For Each cell In AllCell
If cell = 0 Then
cell.EntireRow.Hidden = True
End If
Next
End SubCode: Select all
Sub HideColumns()
Dim cell As Range
Dim AllCell As Range
With Sheets("Sheet1")
Set AllCell = .Range("A1", .Range( _
"A" & Columns.Count).End(xlLeft))
End With
For Each cell In AllCell
If cell = 0 Then
cell.EntireColumn.Hidden = True
End If
Next
End Sub