+ Reply to Thread
Results 1 to 2 of 2

VBA to control Pivot Table Date Filter

  1. #1
    Registered User
    Join Date
    01-02-2012
    Location
    Dorset, England
    MS-Off Ver
    Excel 2007
    Posts
    24

    VBA to control Pivot Table Date Filter

    Hi there!

    I'm trying to write a macro that allows users to control the date filter on a pivot table by entering a start and end date into 2 cells. They then click a button that triggers the macro.

    The code I have so far is:

    Please Login or Register  to view this content.

    This doesn't work, i get 'Application-defined or object-defined error'

    I have also heard that this only works with the date format 'mm/dd/yyyy' so I have tried dates in that format and still no luck.

    Any help would be greatly appreciated!

    Adam

  2. #2
    Registered User
    Join Date
    01-02-2012
    Location
    Dorset, England
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: VBA to control Pivot Table Date Filter

    I am a massive massive tool and didn't spot my stupid mistake.

    PivotFields("Faults")
    should have been PivotFields("Time Painted")!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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