Solved

Remove filter prior to running code

Posted on 2013-10-31
2
190 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 

Accepted Solution

by:
deskchains earned 0 total points
ID: 39615026
Never Mind....

Found a solution:


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

Author Closing Comment

by:deskchains
ID: 39615029
Figured it out...
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

759 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