View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Johan Johansson Johan Johansson is offline
external usenet poster
 
Posts: 5
Default optimizing code? (hide)

I have a drop-down list from where the user can select which day he
wants to see.

At first I hide everything, after that I run the little procedure
below

The problem that I'm having is that this takes lots of time running
this. How do I change the procedure so it will run faster?

Sub show_days()

Dim compare
Application.ScreenUpdating = False

compare = Range("F10").Value

Range("F13").Select

For n = 1 To 8000
ActiveCell.Offset(1, 0).Select
If ActiveCell.Value = compare Then
ActiveCell.EntireRow.Hidden = False
End If
Next n

Application.ScreenUpdating = True

End Sub

/Johan