alecwarner
New Member
- Joined
- Aug 9, 2013
- Messages
- 17
The below code runs pretty fast (few seconds) in Excel 2013, but in Excel 2016 it can be a few minutes.
Does anyone know how to speed up this macro?
Thanks
Al
Sub Hide_Rows_Extra()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Sheet17.Rows("62:82").EntireRow.AutoFit
BeginRow = 62
EndRow = 82
ChkCol = 5
For RowCnt = BeginRow To EndRow
If Sheet17.Cells(RowCnt, ChkCol).Value = 0 Or Sheet17.Cells(RowCnt, ChkCol).Value = "" Then
Sheet17.Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Sheet17.Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
Does anyone know how to speed up this macro?
Thanks
Al
Sub Hide_Rows_Extra()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Sheet17.Rows("62:82").EntireRow.AutoFit
BeginRow = 62
EndRow = 82
ChkCol = 5
For RowCnt = BeginRow To EndRow
If Sheet17.Cells(RowCnt, ChkCol).Value = 0 Or Sheet17.Cells(RowCnt, ChkCol).Value = "" Then
Sheet17.Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Sheet17.Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub