View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Row Height -- Slows VBA

Of course, the statement to unhide the 90 rows should have been...

Rows("1:90").Hidden = False

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
You don't show us any code (always a good idea to include your code) so we
can't see what you are doing, but you can hide/unhide rows all at once
without having to reset the row heights individually. This single line...

Rows("1:90").Hidden = True

will hide rows 1 through 90 and this line...

Rows("1:10").Hidden = False

will unhide them and each row will have the same height it had before it
was hidden.

--
Rick (MVP - Excel)


wrote in message
...
Row heights are static and defined in Cells (FA1:FA100). An hyperlink
event hides Rows (1:90), thereby making their row height equal to
zero. A second hyperlink event unhides Rows (1:90). VBA code loops
through the values in Cells (FA1:F100) to define the appropriate row
height for each row.

This works fine. It works quickly, instantaneously.

Then, however, I'll do either a print or a print preview on the
worksheet. The print and print preview work fine.

Subsequently, however, the time it takes for the code associated with
either hyperlink noticeably increases. Something associated with the
print or print preview alters the behavior of the code that re-
establishes the row height for each row.

I trapped the code and manually processed through the code. With each
loop, one through one hundred, the row height for each row set
properly, but with a brief hour glass display on each pass. Code that
once passed through each row height setting instantaneously now took a
fraction of a second. The cumulative effect of this, over one hundred
row height settings, is quite significant, perhaps fifteen seconds.

The screen update and the enable events are set to false as the code
passes through the loop. The calculation is set to xlManual. The print
setting crams one hundred rows of information into one page. However,
the same problems exist when I remove the "fit to one page" parameter.

Have any of you encountered this? I'm using Excel 2003.

Thank you for your time and consideration.

Michael