+ Reply to Thread
Results 1 to 2 of 2

VBA: Piviot table Month auto select based on current month?

  1. #1
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    VBA: Piviot table Month auto select based on current month?

    I have a macro to pull data from a piviot table. One of the items I am selecting is a drop down box of months It show last couple months through next 6-8 months. I would like my macro to select this month and next 5 months and make all others false. How can I write this. I currently rerecord my macro each month and that is getting old. Here is the part of the macro:

    Sub FilterA()

    Windows("One_Way_Flow.xls").Activate
    Sheets("Net Flow by Week").Select
    With ActiveSheet.PivotTables("PivotTable1").P… Month")
    .PivotItems("Jul-13").Visible = False
    .PivotItems("Feb-14").Visible = False
    End With

    I recorded those to be false but next month I need "Sep-13" through "Feb-14" to be true and everything else to be false. Thanks for the help.

  2. #2
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: VBA: Piviot table Month auto select based on current month?

    would be great if u attached sample workbook, then i can try to make what exactly your looking for...
    Thanks - Naveed
    -----------------------------
    If the suggestion helps you, then Click * to Add Reputation
    To Attach File: Go Advanced>>Manage Attachments>>Add Files (In Top Right Corner)>>SelectFiles>>.........Locate Your File(s)>>Upload Files>>Done (In Bottom Right)
    1. Use [code] code tags [\code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA: Piviot table Month auto select based on current month?
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-21-2013, 07:18 AM
  2. [SOLVED] Help with a system to auto populate month names based on current month
    By rosboy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-01-2012, 05:17 PM
  3. [SOLVED] Auto populate cells from data in a 6 month range starting with the current month
    By ecarnley349 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-21-2012, 07:32 PM
  4. [SOLVED] VBA to identify the current month and previous month based on system date
    By ravikumar00008 in forum Excel General
    Replies: 10
    Last Post: 07-26-2012, 10:04 AM
  5. Replies: 6
    Last Post: 12-09-2011, 03:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1