Solved

Remove filter prior to running code

Posted on 2013-10-31
2
193 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
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.

617 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