+ Reply to Thread
Results 1 to 3 of 3

Macro to select date range in slicer

  1. #1
    Registered User
    Join Date
    08-27-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    76

    Macro to select date range in slicer

    I have a pivot table that has several months worth of data. I have several pivot charts based on that data, and a date slicer linked to multiple charts to select the date range. What I would like to add is a button that lets me automatically select the most recent 7 days of data. Is it possible to have a macro that will update my slicer filter?

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Macro to select date range in slicer

    maybe if you attach a sample file
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    08-27-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: Macro to select date range in slicer

    My workbook is still under construction, and I'm afraid it would only complicate the question.

    I recorded a macro while I manually selected the dates I wanted in the slicer, and this is the code that was generated:

    Please Login or Register  to view this content.
    Is there a way to automate and simplify this? It seems like it should be relatively easy, but I don't know enough VBA to get very far.

+ 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. Replies: 0
    Last Post: 04-04-2013, 02:30 AM
  2. [SOLVED] Macro to select a date range within data with dates
    By akynyemi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2013, 11:58 AM
  3. Slicer Macro - unfilter another slicer on selection
    By chadheins in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-24-2012, 10:41 AM
  4. Macro to select data within a date range.
    By dannymcg in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-12-2012, 05:44 AM
  5. Macro that will select a range within a given date?
    By without_sanity in forum Excel General
    Replies: 4
    Last Post: 05-13-2010, 08:46 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