View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.misc
KL
 
Posts: n/a
Default Macro for hiding rows

Hi Norman,

It should be noted, however, that the constraining factor is independent of the number of blank cells. To demonstrate this try:


Oh yes it is, but not only of the number of blank cells but the way they are distributed. As I said in my previous message "for this
to become an issue in this specific example one needs to have at least 16385 rows where every other row is blank..." In other words
there need to be more than 8192 areas. Your code returns exactly 8192 areas, so try this one (and if you still believe that it is
independent of the # of blank cells, try reproducing the problem with <=8192 blank cells):

Public Sub Demo()
Dim i As Long
Dim rng As Range, rng1 As Range

Application.ScreenUpdating = False
Set rng = Range("A1").Resize(8192 * 3 - 1)
rng.Value = "XYZ"
For i = 1 To rng.Count Step 3
Cells(i, 1).Resize(2).Clear
Next i
Set rng1 = rng.SpecialCells(xlCellTypeBlanks)
MsgBox rng1.Areas.Count
Application.ScreenUpdating = True
Exit Sub
End Sub

Regards,
KL