+ Reply to Thread
Results 1 to 2 of 2

Filter between dates by cell dates instead of input

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    494

    Filter between dates by cell dates instead of input

    Sub CHART_DATERANGE_INSPECTIONS()
       ActiveSheet.PivotTables("DATA").PivotFields("DATE").ClearAllFilters
        ActiveSheet.PivotTables("DATA").PivotFields("DATE").PivotFilters.Add Type:=xlDateBetween, Value1:=Sheets("PIVOTDATA").Range("C5").Value, Value2:=Sheets("PIVOTDATA").Range("C7").Value
    '    ActiveSheet.PivotTables("DATA").PivotFields("DATE").PivotFilters.Add Type:=xlDateBetween, Value1:="4/03/2013", Value2:="20/03/2013"
    End Sub
    I am trying to set a cell value for the start and end date (C5 & C&) and have a macro filter the data in the chart by a Between Dates filter.

    If i record the task, and change the dates to the sheet ranges, i get no filtering.

    How can i accomplish this?

  2. #2
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    494

    Re: Filter between dates by cell dates instead of input

    I have managed to solve this now.
    I had to set the range as .text instead of .value.

+ 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