Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
vba code on autofilter | Excel Discussion (Misc queries) | |||
Macro turn off AutoFilter | Excel Worksheet Functions | |||
Autofilter code | Excel Discussion (Misc queries) | |||
Excel 2003 - turn off option in autofilter | Excel Discussion (Misc queries) | |||
Turn this into VBA code | Excel Programming |