Confirm AutoFilter is on

mcnealfbm

New Member
Joined
Jul 12, 2004
Messages
33
I have a macro that copies data from one page to other pages based on various filter criteria. It works perfectly as long as when I start the macro, the main worksheet already has the filters on. If there are no filters in place then it stops the first time it needs to filter on a column.

I tried
Selection.CurrentRegion.Select
Selection.AutoFilter

But if the filters are on, it turns them off.

I tried using EnableAutoFilter = True
but that didn't.

Is there something simple once I've selected my range to turn on filters if they are off, or to leave them on if they are on?

Frances
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Try something like this

<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> filters()<br><SPAN style="color:#00007F">With</SPAN> ActiveSheet<br><br>            .AutoFilterMode = <SPAN style="color:#00007F">False</SPAN><br><br>            .Range("A1:D1").AutoFilter<br><br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN><br></FONT>
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

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