Solved

Remove filter prior to running code

Posted on 2013-10-31
2
185 Views
Last Modified: 2013-10-31
I have a series of macros and code that manipulates data.  Problem i have today is that if a user processes the data once, takes a look at what they did/happened filters the data, and then runs the code again it bombs. - Code wont run right if the data is filtered (multiple tables and pivots)

For the pivot tables i have no problems.  I have some code that goes to the offending pivot table prior to the execution of the code and runs clears the filter(s)

for tables i have an issue.  Prior to execution I run some code that goes to the worksheet that the table is on and clear the filters using:

ActiveSheet.ShowAllData

Works fine as long as the data is filtered, if the data has not been filtered it throws an error...

I need to either be able to tell/determine if the data on a particular worksheet has been filtered and then run:

If data is filtered then
   ActiveSheet.ShowAllData

Or use a different method of unfiltering the data.

Thanks...
0
Comment
Question by:deskchains
  • 2
2 Comments
 

Accepted Solution

by:
deskchains earned 0 total points
Comment Utility
Never Mind....

Found a solution:


Sheets("BAF Data").Select
    If ActiveSheet.FilterMode Then
    ActiveSheet.ShowAllData
  End If
0
 

Author Closing Comment

by:deskchains
Comment Utility
Figured it out...
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now