Switching custom views in Excel when filtering

15 pts.
Tags:
Excel 2003
Excel macros
Microsoft Excel
VBA
I have a very large spreadsheet that I navigate using custom views. I change views using macros because I have a couple of other commands that I want executed as well. I also commonly filter the rows of the spreadsheet. However, when I switch views, the filter is turned off, and I would like it to remain filtered as is. Is there a way to stop the filtering from being turned off? Or can I get the setting with a VB command and then reapply it at the end of the macro? Thanks!
ASKED: March 27, 2008  3:13 PM
UPDATED: March 29, 2008  5:53 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

It sounds like you want to display a custom view, then switch to another custom view while keeping the previous one. In principle that makes no sense. You can’t display more than one custom view at a time (someone correct me if I’m wrong, but it doesn’t sound right).

Are you trying to layer views? It would just be a third custom view which is a combination of both.

The way I do it is set up the worksheet the way you want it displayed, create the custom view, then record a macro of yourself selecting that view. Then use that code as the basis for a command button.

HTH,
JP

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • YuvalShavit
    This is not a very complete answer, but take a look at the VBA AutoFilter object. I believe its getters and setters should be helpful for what you're trying to do. Sorry I can't be of more specific help; I haven't worked with AutoFilter much in VBA.
    905 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following