PC Review


Reply
Thread Tools Rate Thread

Catch Error on Filter Sub

 
 
jfitzpat
Guest
Posts: n/a
 
      22nd Feb 2010
I have a sub that clears the previous filters to show all rows. If no
filter is on then it halts with an error. How do I set an if stmt so this
clear does not run or how do I set error catching to the sub just goes to the
next step. I tried some basics that I found but they dont work so my syntax
might be wrong. I commented out the things I tried that did not work.

Sub ShowAllRows()
'
' ShowAllRows Macro
'
' If ActiveSheet.ShowAllData = False Then
ActiveSheet.ShowAllData
' On Error Resume Next
Range("J10").Select

End Sub

 
Reply With Quote
 
 
 
 
wayneL
Guest
Posts: n/a
 
      4th May 2010


"jfitzpat" wrote:

> I have a sub that clears the previous filters to show all rows. If no
> filter is on then it halts with an error. How do I set an if stmt so this
> clear does not run or how do I set error catching to the sub just goes to the
> next step. I tried some basics that I found but they dont work so my syntax
> might be wrong. I commented out the things I tried that did not work.
>


'This works ...sort of

If ActiveSheet.FilterMode Then
ActiveSheet.ShowAllData
End If

'I find if too muchdata is filtered out this crashes
'Actually even using the built in menu command crashes (hangs) excel


> Sub ShowAllRows()
> '
> ' ShowAllRows Macro
> '
> ' If ActiveSheet.ShowAllData = False Then
> ActiveSheet.ShowAllData
> ' On Error Resume Next
> Range("J10").Select
>
> End Sub
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to catch error 401 access denied and redirect to custom error page ? rote Microsoft ASP .NET 4 4th Aug 2008 08:27 PM
try..catch catch the error only running inside of VS.NET Dragos Hilbert Microsoft C# .NET 2 11th Mar 2008 03:35 PM
Outlook filter used to be great. Catch up with the marketers.... =?Utf-8?B?TkNCYW5kaXQ=?= Microsoft Outlook Discussion 1 13th Aug 2006 07:11 AM
Catch block is failing to catch exceptions when not run from MSDev CodeSlayer Microsoft C# .NET 2 16th Feb 2006 06:42 PM
JunkMail filter should catch emails from incomplete domain =?Utf-8?B?YmxvbmR0cmFpbGxpdGU=?= Microsoft Outlook Discussion 0 8th Jun 2005 02:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:00 PM.