Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default test for autofilter

Thanks Chip, but actually found more what I'm looking for
somewhere else...here's what i found FYI...

'Test to see if AutoFilter is on if so turn it off
If ActiveSheet.AutoFilterMode Then
Selection.AutoFilter
End If

'Initiate AutoFilter
Rows("1:1").Select
Selection.AutoFilter


-----Original Message-----
Test the AutoFilterMode property of the Worksheet. E.g.,

If Worksheets(1).AutoFilterMode = True Then
' whatever


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"kayla711" wrote in message
...
Hello all,

I've created a spreadsheet that basically opens up

another
workbook, filters two columns using AutoFilter, selects
several columns of the filtered data, and then pastes it
in the original spreadsheet. This works fabulously, no
problems here.

My question is this: how can I have Excel test to see if
AutoFilter is on or off? What I need it to do is test to
see if AutoFilter's on, and if it is, go on with the
macro, and if it's not, turn it on, then go on with the
macro. Anyone know?

btw, Office 97 on win2k

TIA!



.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default test for autofilter

You use Autofiltermode as Chip suggested, but you test if it is applied, and
if so, clear it, then reapply it.

Why not just use showall if it is applied and continue from there, else
apply it.

Regards,
Tom Ogilvy




kayla711 wrote in message
...
Thanks Chip, but actually found more what I'm looking for
somewhere else...here's what i found FYI...

'Test to see if AutoFilter is on if so turn it off
If ActiveSheet.AutoFilterMode Then
Selection.AutoFilter
End If

'Initiate AutoFilter
Rows("1:1").Select
Selection.AutoFilter


-----Original Message-----
Test the AutoFilterMode property of the Worksheet. E.g.,

If Worksheets(1).AutoFilterMode = True Then
' whatever


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"kayla711" wrote in message
...
Hello all,

I've created a spreadsheet that basically opens up

another
workbook, filters two columns using AutoFilter, selects
several columns of the filtered data, and then pastes it
in the original spreadsheet. This works fabulously, no
problems here.

My question is this: how can I have Excel test to see if
AutoFilter is on or off? What I need it to do is test to
see if AutoFilter's on, and if it is, go on with the
macro, and if it's not, turn it on, then go on with the
macro. Anyone know?

btw, Office 97 on win2k

TIA!



.



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
excel 2007 autofilter change to 2003 autofilter functionality? jonnybrovo815 Excel Discussion (Misc queries) 1 April 19th 10 10:05 PM
2007 excel autofilter back to 2003 autofilter? jonnybrovo815 Excel Discussion (Misc queries) 3 April 19th 10 08:11 PM
2007 excel autofilter change back to 2003 autofilter? jonnybrovo815 Excel Discussion (Misc queries) 1 April 19th 10 05:53 PM
2007 Autofilter worse than 2003 Autofilter jsky Excel Discussion (Misc queries) 9 October 31st 07 12:14 AM
Calculate mean of test scores from rows of test answers RiotLoadTime Excel Discussion (Misc queries) 1 July 26th 06 05:14 PM


All times are GMT +1. The time now is 05:02 AM.

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

About Us

"It's about Microsoft Excel"