tommychowdah
New Member
- Joined
- Dec 26, 2017
- Messages
- 31
Sorry for the spelling error ^
Hi Everyone,
I am using the following macro to hide rows throughout my workbook. In the pat it had worked perfectly, but just started crashing. is there a way to see what tab the macro crashes on? Maybe there is something you can add to the code. Thank you!
Hi Everyone,
I am using the following macro to hide rows throughout my workbook. In the pat it had worked perfectly, but just started crashing. is there a way to see what tab the macro crashes on? Maybe there is something you can add to the code. Thank you!
Code:
Sub Hide_All_Rows()
Dim sht As Worksheet
Application.ScreenUpdating = True
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
Last edited by a moderator: