Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default 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






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default 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








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default 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








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default 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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
vba code on autofilter ub Excel Discussion (Misc queries) 1 August 6th 08 08:09 PM
Macro turn off AutoFilter Erin Excel Worksheet Functions 2 February 26th 08 08:38 PM
Autofilter code Dominic LeVasseur Excel Discussion (Misc queries) 2 August 16th 06 09:33 PM
Excel 2003 - turn off option in autofilter Gasper Excel Discussion (Misc queries) 1 February 1st 06 11:34 AM
Turn this into VBA code Don[_9_] Excel Programming 2 September 15th 03 03:45 PM


All times are GMT +1. The time now is 11:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"