Created
November 13, 2016 10:42
-
-
Save dawncold/1047d659e00e9668bde5dcafd994a18b to your computer and use it in GitHub Desktop.
hide some rows in excel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub LoopThroughSheets() | |
Dim ws As Worksheet | |
Dim endDate As Date | |
endDate = DateValue("2016/10/09") | |
For Each ws In ActiveWorkbook.Worksheets | |
If ws.Name <> "汇总" Then | |
For Each rw In ws.Rows | |
If rw.Cells(1).Value = "" Then | |
Exit For | |
End If | |
If rw.Cells(1) <> "日期" And Not rw.EntireRow.Hidden Then | |
If CDate(rw.Cells(1).Value) < endDate Then | |
rw.EntireRow.Hidden = True | |
End If | |
End If | |
Next rw | |
End If | |
Next ws | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment