Hide many rows without loop?

T

T. Skogstrom

Hi,

I need to check the A:A cell in rows 778:876, 884:982, 989:1087 to see
if it is empty ( "" ). If cells A:A are empty, I want its row to be
hidden when I open the sheet. Now, with a new PC it takes 30 seconds
to make a loop with a Worksheet_Activate event.

Can someone help me do this fast, without using a loop?


/Regards
Gunnar
 
R

Ron de Bruin

Hi

Do you mean really emty or do you have formulas that
that evaluates to ""
 
R

Ron de Bruin

Maybe this is faster for you

Sub FindExample()
Dim Rng As Range
Application.ScreenUpdating = False
Do
Set Rng = Range("A778:A876, A884:A982, A989:A1087"). _
Find(What:="", _
After:=Range("A778"), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then Rng.EntireRow.Hidden = True
Loop While Not (Rng Is Nothing)
Application.ScreenUpdating = True
End Sub
 
Top