LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Hiding Empty Rows

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding Various Empty Rows Matthew[_2_] Excel Discussion (Misc queries) 1 July 20th 07 08:12 PM
Delete Rows with Empty Cells with empty column 1 Scott Excel Programming 5 October 2nd 06 11:57 PM
How do I sort with empty rows between none empty rows? Excel Challenged Excel Worksheet Functions 1 August 17th 06 03:59 PM
Hiding a button when hiding rows fergusor Excel Discussion (Misc queries) 2 August 10th 06 02:31 PM
Hiding an empty row? british.assassi[_7_] Excel Programming 3 January 22nd 06 11:32 PM


All times are GMT +1. The time now is 11:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"