Thread: Macro speed
View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Rex Rex is offline
external usenet poster
 
Posts: 26
Default Macro speed

Awesome. Thanks for your help
--
Rex Munn


"Don Guillett" wrote:

Sub hiderowsif()
Dim lr As Long
lr = Cells(Rows.Count, "c").End(xlUp).Row
Range("C1:c" & lr).AutoFilter Field:=1, _
Criteria1:="<0", Operator:=xlAnd, Criteria2:="<"
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Rex" wrote in message
...
The code shown below runs through about 6000 rows and takes 5 minutes or
so
to sort the data and hide the rows. Does anyone know how to change this
to
make it run faster?
Thanks for your help.

Dim R As Range
For Each R In Range("c7:c6210")
If R.Value = "0" Then Rows(R.Row).Hidden = True
If R.Value = "" Then Rows(R.Row).Hidden = True
Next

--
Rex Munn


.