Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default What if AutoFilter is NOT on?

I've spent some time here getting tips and code on incrementing through an
AutoFiltered range. Thanks to the great efforts of good people much smarter
than I, these macros work wonders for me. Now I "broke" one - by trying to
use it on an UNfiltered workbook! It errored on the line:
Set rng = ActiveSheet.AutoFilter.Range


What is the best way to handle this? On Error Resume Next? Or is there a
test: "If AutoFilter = True Then"?

Ed


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default What if AutoFilter is NOT on?

Hi Ed

To Test for an autofilter, you can use the AutofilterMode property::

If Activesheet.AutoFilterMode Then
'There is an autofilter
'Do something
Else
'No autofilter
'Do something else
End If

If you need to check if any rows are hidden by a filter, use the FilterMode
property.

---
Regards,
Norman



"Ed" wrote in message
...
I've spent some time here getting tips and code on incrementing through an
AutoFiltered range. Thanks to the great efforts of good people much

smarter
than I, these macros work wonders for me. Now I "broke" one - by trying

to
use it on an UNfiltered workbook! It errored on the line:
Set rng = ActiveSheet.AutoFilter.Range


What is the best way to handle this? On Error Resume Next? Or is there a
test: "If AutoFilter = True Then"?

Ed




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default What if AutoFilter is NOT on?

Thanks, Norman. I appreciate the boost.

Ed

"Norman Jones" wrote in message
...
Hi Ed

To Test for an autofilter, you can use the AutofilterMode property::

If Activesheet.AutoFilterMode Then
'There is an autofilter
'Do something
Else
'No autofilter
'Do something else
End If

If you need to check if any rows are hidden by a filter, use the

FilterMode
property.

---
Regards,
Norman



"Ed" wrote in message
...
I've spent some time here getting tips and code on incrementing through

an
AutoFiltered range. Thanks to the great efforts of good people much

smarter
than I, these macros work wonders for me. Now I "broke" one - by trying

to
use it on an UNfiltered workbook! It errored on the line:
Set rng = ActiveSheet.AutoFilter.Range


What is the best way to handle this? On Error Resume Next? Or is there

a
test: "If AutoFilter = True Then"?

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
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
How to Sort within AutoFilter with Protection on (and AutoFilter . giblon Excel Discussion (Misc queries) 1 February 16th 06 12:23 PM


All times are GMT +1. The time now is 10:19 PM.

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"