PC Review


Reply
Thread Tools Rate Thread

How can I get a macro to know when it false and run a different ma

 
 
=?Utf-8?B?U2hhd243Nzc=?=
Guest
Posts: n/a
 
      17th Aug 2007
If the macro / code turns out to be an error Then run a different macro.

The code is:
ActiveSheet.ShowAllData

but if it is already showing all then the macro shuts down with an error
message.
Instead I want it to realize it doesn’t work and run a different macro
instead.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      17th Aug 2007
Showall data fails becuase you don't have aoutfiltering on. You need to test
for auto filtering as follows:

Sub test()

With ActiveSheet
If .AutoFilterMode Then
.ShowAllData
Else
' enter your alternate code
End If
End With

End Sub


"Shawn777" wrote:

> If the macro / code turns out to be an error Then run a different macro.
>
> The code is:
> ActiveSheet.ShowAllData
>
> but if it is already showing all then the macro shuts down with an error
> message.
> Instead I want it to realize it doesn’t work and run a different macro
> instead.
>

 
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
VBA always creates linked chart even when using PasteExcelTable False, False, False in Office 2007 Matt Simpson Microsoft Excel Programming 0 6th Aug 2007 08:11 PM
function true false to macro ?? steve Microsoft Access 1 3rd Apr 2007 07:32 PM
Automatically run a macro when a cell = FALSE =?Utf-8?B?Sm9uYXRoYW4gTmV1YmF1ZXI=?= Microsoft Excel Programming 2 31st Jan 2005 09:28 AM
Macro to find and delete all FALSE statements =?Utf-8?B?V29vZHkxMw==?= Microsoft Excel Misc 3 8th Dec 2004 11:16 PM
False macro indication Graham Hill Microsoft Excel Discussion 3 8th Mar 2004 12:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:30 PM.