Hi, this code is very slow, and I don't know why. It is a dropdown list in B1. And whenever I choose a name, it takes long time to calculate. Anybody?
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Integer
Application.ScreenUpdating = False
If Not Application.Intersect(Range("B1"), Range(Target.Address)) Is Nothing Then
Select Case Target.Value
Case Is = "Text":
For i = 3 To 500
If Range("AK" & i).Value = "Text" Then
Rows(i).EntireRow.Hidden = False
Else: Rows(i).EntireRow.Hidden = True
End If
Next i
Case Is = "Text":
For i = 3 To 500
If Range("AK" & i).Value = "Text" Then
Rows(i).EntireRow.Hidden = False
Else: Rows(i).EntireRow.Hidden = True
End If
Application.ScreenUpdating = True
End Select
End Sub