tommychowdah
New Member
- Joined
- Dec 26, 2017
- Messages
- 31
Hello Everyone,
Question for you. I have been using the following code to hide rows based on a cell value. The macro has worked wonderfully, but today it crashes. Any thoughts would be much appreciated!
Sub Hide_All_Rows()
Dim sht As Worksheet
Application.ScreenUpdating = False
For Each sht In Worksheets
beginRow = 1
endRow = 1000
chkCol = 702
For RowCnt = beginRow To endRow
If sht.Cells(RowCnt, chkCol).Value = "1" Then
sht.Cells(RowCnt, chkCol).EntireRow.Hidden = True
Else
sht.Cells(RowCnt, chkCol).EntireRow.Hidden = False
End If
Next RowCnt
Next sht
Application.ScreenUpdating = True
End Sub
Best,
Chowdah
Question for you. I have been using the following code to hide rows based on a cell value. The macro has worked wonderfully, but today it crashes. Any thoughts would be much appreciated!
Sub Hide_All_Rows()
Dim sht As Worksheet
Application.ScreenUpdating = False
For Each sht In Worksheets
beginRow = 1
endRow = 1000
chkCol = 702
For RowCnt = beginRow To endRow
If sht.Cells(RowCnt, chkCol).Value = "1" Then
sht.Cells(RowCnt, chkCol).EntireRow.Hidden = True
Else
sht.Cells(RowCnt, chkCol).EntireRow.Hidden = False
End If
Next RowCnt
Next sht
Application.ScreenUpdating = True
End Sub
Best,
Chowdah