Autofilter

A

Angeles

Hi , I have a table with autofilter at the bottom (it is in the row 500 ) of
my sheet , excel does not let me to unhide rows in the top of my sheet when
the autofilter is activated , I am talking about the rows 1- 499 , it lets me
unhide rows only when the autofilter is unactivated (looks like excel bug),
so I am trying this :

ActiveWorkbook.Worksheets("Sheet1").AutoFilterMode = False

it sets unactivated the autofilter , after that I am hiding and showing the
rows that I need , but after that I need to activate again the autofilter , I
am trying :

ActiveWorkbook.Worksheets("Part Appl Guidelines").AutoFilterMode = true

but it does not work , it shows an error message, somebody can help me ?

Thank you in advance.
 
A

Angeles

After of this :
ActiveWorkbook.Worksheets("Sheet1").AutoFilterMode = true

I am doing this :

ActiveWorkbook.Sheets("Sheet1").Range("F101").AutoFilter 2, "My criteria 1"

I am getting the error message in this line.
 
W

WHA

I think you can set a sheet's AutoFilterMode to False but not to True.
VBA needs to know exactly where the headers are. Some ideas:

Is there a gap between the top rows and the filter headers? I believe
there needs to be one completely empty row above the headers.

From your other post: the following line looks OK to me (I added
argument names for clarity):
ActiveWorkbook.Sheets("Sheet1").Range("F101").AutoFilter Field:=2,
Criteria1:="My criteria 1"

You might need to put the following line ABOVE that line:
ActiveWorkbook.Sheets("Sheet1").Range("F101").AutoFilter

Also: Are you sure of what the headers are in the region that has
autofilter on it? "Field:=2" is correct only if you're filtering on
the second header from the left.

fyi: I figured out the above by recording a macro then looking at the
produced code. good luck

WHA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top