ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Turn AutoFilter off by code? (https://www.excelbanter.com/excel-programming/277835-turn-autofilter-off-code.html)

Ed[_9_]

Turn AutoFilter off by code?
 
I'm trying to turn off the AutoFilter in a macro using the following code:
ActiveSheet.Select
Sheet1.AutoFilterMode = False

Of course, the reason I'm posting is that it doesn't work. It's stored in
my Personal.xls, and needs to be used on the spreadsheets I create (I use a
certain template that will always have the information to be filtered on
Sheet1). Any help is appreciated.

Ed



JohnI in Brisbane

Turn AutoFilter off by code?
 
Ed,

ActiveSheet.AutoFilterMode = False

or

Worksheets("Sheet1").AutoFilterMode = False

regards,

JohnI


"Ed" wrote in message
...
I'm trying to turn off the AutoFilter in a macro using the following code:
ActiveSheet.Select
Sheet1.AutoFilterMode = False

Of course, the reason I'm posting is that it doesn't work. It's stored in
my Personal.xls, and needs to be used on the spreadsheets I create (I use

a
certain template that will always have the information to be filtered on
Sheet1). Any help is appreciated.

Ed





steve

Turn AutoFilter off by code?
 
Ed,

Try using:

ActiveSheet.AutoFilterMode = False

or
Sheets("Sheet1").AutoFilterMode = False

(Your code is looking for Sheet1 where Sheet1 is defined as Worksheet.)
Surprised you are not getting an error message...
--
sb
"Ed" wrote in message
...
I'm trying to turn off the AutoFilter in a macro using the following code:
ActiveSheet.Select
Sheet1.AutoFilterMode = False

Of course, the reason I'm posting is that it doesn't work. It's stored in
my Personal.xls, and needs to be used on the spreadsheets I create (I use

a
certain template that will always have the information to be filtered on
Sheet1). Any help is appreciated.

Ed





Ed[_9_]

Turn AutoFilter off by code?
 
Steve - that did it! Thank you. I used the sescond one, and it did the
job.

I *was* getting an error code, but nothing I tried would work.

So my code was looking for 'Sheet number 1' instead of 'Sheet named "Sheet1"
' I'll have to remember that *little* detail. 8/

Ed

"steve" wrote in message
...
Ed,

Try using:

ActiveSheet.AutoFilterMode = False

or
Sheets("Sheet1").AutoFilterMode = False

(Your code is looking for Sheet1 where Sheet1 is defined as Worksheet.)
Surprised you are not getting an error message...
--
sb
"Ed" wrote in message
...
I'm trying to turn off the AutoFilter in a macro using the following

code:
ActiveSheet.Select
Sheet1.AutoFilterMode = False

Of course, the reason I'm posting is that it doesn't work. It's stored

in
my Personal.xls, and needs to be used on the spreadsheets I create (I

use
a
certain template that will always have the information to be filtered on
Sheet1). Any help is appreciated.

Ed







Ed[_9_]

Turn AutoFilter off by code?
 
Thanks for replying, John. I appreciate the help.

Ed

"JohnI in Brisbane" wrote in message
...
Ed,

ActiveSheet.AutoFilterMode = False

or

Worksheets("Sheet1").AutoFilterMode = False

regards,

JohnI


"Ed" wrote in message
...
I'm trying to turn off the AutoFilter in a macro using the following

code:
ActiveSheet.Select
Sheet1.AutoFilterMode = False

Of course, the reason I'm posting is that it doesn't work. It's stored

in
my Personal.xls, and needs to be used on the spreadsheets I create (I

use
a
certain template that will always have the information to be filtered on
Sheet1). Any help is appreciated.

Ed







steve

Turn AutoFilter off by code?
 
Ed,

Just another of those things to keep straight when working with code...

Very glad that it worked!!!

--
sb
"Ed" wrote in message
...
Steve - that did it! Thank you. I used the sescond one, and it did the
job.

I *was* getting an error code, but nothing I tried would work.

So my code was looking for 'Sheet number 1' instead of 'Sheet named

"Sheet1"
' I'll have to remember that *little* detail. 8/

Ed

"steve" wrote in message
...
Ed,

Try using:

ActiveSheet.AutoFilterMode = False

or
Sheets("Sheet1").AutoFilterMode = False

(Your code is looking for Sheet1 where Sheet1 is defined as Worksheet.)
Surprised you are not getting an error message...
--
sb
"Ed" wrote in message
...
I'm trying to turn off the AutoFilter in a macro using the following

code:
ActiveSheet.Select
Sheet1.AutoFilterMode = False

Of course, the reason I'm posting is that it doesn't work. It's

stored
in
my Personal.xls, and needs to be used on the spreadsheets I create (I

use
a
certain template that will always have the information to be filtered

on
Sheet1). Any help is appreciated.

Ed









Don Guillett[_4_]

Turn AutoFilter off by code?
 
If you want to keep it but restore the "before filter" try
Sub ShowAll()
On Error GoTo away
ActiveSheet.ShowAllData
away:
End Sub


"Ed" wrote in message
...
I'm trying to turn off the AutoFilter in a macro using the following code:
ActiveSheet.Select
Sheet1.AutoFilterMode = False

Of course, the reason I'm posting is that it doesn't work. It's stored in
my Personal.xls, and needs to be used on the spreadsheets I create (I use

a
certain template that will always have the information to be filtered on
Sheet1). Any help is appreciated.

Ed






All times are GMT +1. The time now is 04:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com