Hidden Rows become visible after Autofilter

jerkyjerk

New Member
Joined
Sep 7, 2009
Messages
34
I have the following code,
In the for loop, some rows are hidden
After the loop, I used Autofilter
Problem is, after the Application.Calculation = xlCalculationAutomatic line
Those hidden rows became visible again.
What seems to be lacking here?
Please help me..

Note: All cells have formula in it.

Code:
Application.Calculation = xlCalculationManual
For lngRow = Range("A" & Rows.Count).End(xlUp).Row - 8 To 3 Step -9
            lngARow= lngRow + 1
            lngBRow = lngRow + 4
            If Cells(lngARow, 1) = 0 And Cells(lngBRow, 2) = 0 Then
                Rows(lngRow & ":" & lngRow + 8).Select
                Selection.EntireRow.Hidden = True
            End If
Next lngRow
        
Range("$A$2:$R$2").AutoFilter Field:=1, Criteria1:=Array("02", "04", "05", "08", "09"), Operator:=xlFilterValues
Application.Calculation = xlCalculationAutomatic
 
Last edited:

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Forum statistics

Threads
1,203,240
Messages
6,054,319
Members
444,717
Latest member
melindanegron

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top