Hello good people, I just registered but I have been an anonymous user using this forum for most of all my self-taught VBA life.
This is probably one of the most simple codes i've ever wrote yet it's EXTREMELY slow, and I can't figure out why.
All it does is hide some specific lines on sheets that i need not to appear and would be just too painful to make all of this manually.
Any thoughts on why it's being so slow? When I mean slow I mean it's taking 10min+ to run in 20 sheets with 100-200 rows each.
Excel is 2013 on Windows 8
Thanks in advance!
This is probably one of the most simple codes i've ever wrote yet it's EXTREMELY slow, and I can't figure out why.
All it does is hide some specific lines on sheets that i need not to appear and would be just too painful to make all of this manually.
Any thoughts on why it's being so slow? When I mean slow I mean it's taking 10min+ to run in 20 sheets with 100-200 rows each.
Excel is 2013 on Windows 8
Thanks in advance!
Code:
Sub arrumaorç()
Application.ScreenUpdating = False
For n = 2 To Worksheets.Count - 2
x = 2
Sheets(n).Activate
Do Until Cells(x, 2).Value = "Total Geral"
If Cells(x, 2).Interior.TintAndShade > 0 Or Cells(x, 2).Interior.Color = 13434828 Or Cells(x, 2).Interior.Color = 10092543 Then
Cells(x, 2).EntireRow.Hidden = True
Else: x = x + 1
End If
Loop
Next n
End Sub