A
AJ Master
I have been using the code below to hide empty rows in a worksheet.
Originally I was only evaluating 12 columns (one for each month of
the year) in each of about 100 rows to determine whether to hide the
entire row. The number of rows has grown to about 350 and now the
code runs rather slow. About 7-10secs versus the 2 secs it used to
take. Anyone with any ideas on how to improved the speed of this
code??
Dim bytCol As Byte
Dim lngRow As Integer
Application.ScreenUpdating = False
For lngRow = 8 To 359 'All Rows
For bytCol = 4 To 15 'Columns D-O
If ActiveSheet.Cells(lngRow, bytCol) <> 0 Then Exit For
If bytCol = 15 Then ActiveSheet.Rows(lngRow).Hidden = True
Next bytCol
Next lngRow
Application.ScreenUpdating = True
Thanks....AJ
Originally I was only evaluating 12 columns (one for each month of
the year) in each of about 100 rows to determine whether to hide the
entire row. The number of rows has grown to about 350 and now the
code runs rather slow. About 7-10secs versus the 2 secs it used to
take. Anyone with any ideas on how to improved the speed of this
code??
Dim bytCol As Byte
Dim lngRow As Integer
Application.ScreenUpdating = False
For lngRow = 8 To 359 'All Rows
For bytCol = 4 To 15 'Columns D-O
If ActiveSheet.Cells(lngRow, bytCol) <> 0 Then Exit For
If bytCol = 15 Then ActiveSheet.Rows(lngRow).Hidden = True
Next bytCol
Next lngRow
Application.ScreenUpdating = True
Thanks....AJ