Macros and auto filter

misslisaann

New Member
Joined
Feb 12, 2005
Messages
3
When I set my macros I included auto filters. When I run the macro it leaves the auto filter on. I then choose data-filters and uncheck auto filter and it reverts back to the original. How can I get my macros to run using auto filter and save the data with the autofilter not showing. I have windows xp with excel 2002 :rolleyes:
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Welcome to the board Misslisaann,

If what you are asking is how to turn off autofilter as your macro completes, just put the following line of code at the end of your macro;
Worksheets("Sheet1").AutoFilterMode = False
Be sure to change the sheetname to what you are using.
 
Upvote 0
..

If Worksheets("Sheet1").AutoFilterMode Then Selection.AutoFilter

will turn off filters if they were on., then save wb

Chas
 
Upvote 0

Forum statistics

Threads
1,215,793
Messages
6,126,934
Members
449,349
Latest member
Omer Lutfu Neziroglu

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