there is workaround..try bellow code..

Sub abc()
Dim Field As PivotField, fDate
Set Field = Sheets("Pivot").PivotTables("PivotTable1").PivotFields("Created
Date")
fDate = DateSerial(2015, 1, 23) * 1
With Sheets("Pivot").PivotTables("PivotTable1").PivotFields("Created Date")
        .Orientation = xlPageField
        .Position = 1
        .EnableMultiplePageItems = True
End With
Sheets("Pivot").PivotTables("PivotTable1").ClearAllFilters

With Field
On Error Resume Next
For i = 1 To Field.PivotItems.Count
'            Debug.Print Left(.PivotItems(i).Value, 10)
tt = Left(.PivotItems(i).Value, 10)
cmpDt = DateSerial(Right(tt, 4), Left(tt, 2), Mid(tt, 4, 2)) * 1
    If cmpDt <> fDate Then
        .PivotItems(i).Visible = False
        Else
        .PivotItems(i).Visible = True
    End If
Next i

End With

End Sub


Cheers!!

ᐧ

On Tue, Jan 27, 2015 at 8:46 PM, Vaibhav Joshi <v...@vabs.in> wrote:

> Is your pivot table in Sheet name Pivot & it should be 1st pivot table in
> your sheet,
>
> Also check date format, you need to give exact same format i.e. m/d/y
> hh:ss. Colb has date & time format while you are giving only date in filter.
>
> ᐧ
>
> On Tue, Jan 27, 2015 at 8:17 PM, Nitin Balodi <nitinbal...@live.com>
> wrote:
>
>> Hi Vaibhav,
>>
>> Thanks for your response. I have tried code you had suggested but it
>> showing me object defined or application defined error.
>>
>>
>> Regards.
>>
>> Yours Sincerely,
>> *Nitin Balodi*
>>
>>
>> ------------------------------
>> From: v...@vabs.in
>> Date: Tue, 27 Jan 2015 16:50:17 +0530
>> Subject: Re: $$Excel-Macros$$ Date Filters in Pivot Table Report Filter
>> in VBA
>> To: excel-macros@googlegroups.com
>>
>>
>> Instead of ActiveSheet you can also use:
>>
>> Sheets("Pivot").PivotTables("PivotTable1").PivotFields("Created
>> Date").CurrentPage _
>>         = #1/25/2015#
>> ᐧ
>>
>> On Tue, Jan 27, 2015 at 4:48 PM, Vaibhav Joshi <v...@vabs.in> wrote:
>>
>> Hi
>>
>> Since it is report filter your method wont work..
>>
>> you can try replacing last line with with following two or last one
>> only...
>>
>> Sheets("Pivot").PivotTables("PivotTable1").ClearAllFilters
>> ActiveSheet.PivotTables("PivotTable1").PivotFields("Created
>> Date").CurrentPage _
>>         = #1/23/2015#
>>
>> Cheers!!
>>
>> ᐧ
>>
>> On Tue, Jan 27, 2015 at 2:56 AM, Nitin Balodi <nitinbal...@live.com>
>> wrote:
>>
>> Hi Experts,
>>
>> I am having some issues in filtering data in pivot tables and require
>> your help. I have to filter all the data of yesterday date in pivot table.
>> I have added Created Date column to Page Field using VBA but unable to
>> filter out data with Create date of yesterday. Please refer to attached
>> file for your reference.
>>
>> Code snippet I had written is:
>>
>> *With Sheets("Pivot").PivotTables("PivotTable1").PivotFields("Created
>> Date")*
>> *        .Orientation = xlPageField*
>> *        .Position = 1*
>> *        .EnableMultiplePageItems = True*
>> *End With*
>> *Sheets("Pivot").PivotTables("PivotTable1").PivotFields("Created
>> Date").PivotFilters.Add Type:=xlSpecificDate, Value1:="01/23/2015"*
>>
>> Many thanks for your help in advance.
>>
>> Regards.
>>
>> Yours Sincerely,
>> *Nitin Balodi*
>>
>> --
>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
>> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
>> https://www.facebook.com/discussexcel
>>
>> FORUM RULES
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>> will not get quick attention or may not be answered.
>> 2) Don't post a question in the thread of another member.
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>> 4) Acknowledge the responses you receive, good or bad.
>> 5) Jobs posting is not allowed.
>> 6) Sharing copyrighted material and their links is not allowed.
>>
>> NOTE : Don't ever post confidential data in a workbook. Forum owners and
>> members are not responsible for any loss.
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "MS EXCEL AND VBA MACROS" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to excel-macros+unsubscr...@googlegroups.com.
>> To post to this group, send email to excel-macros@googlegroups.com.
>> Visit this group at http://groups.google.com/group/excel-macros.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>>
>> --
>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
>> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
>> https://www.facebook.com/discussexcel
>>
>> FORUM RULES
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>> will not get quick attention or may not be answered.
>> 2) Don't post a question in the thread of another member.
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>> 4) Acknowledge the responses you receive, good or bad.
>> 5) Jobs posting is not allowed.
>> 6) Sharing copyrighted material and their links is not allowed.
>>
>> NOTE : Don't ever post confidential data in a workbook. Forum owners and
>> members are not responsible for any loss.
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "MS EXCEL AND VBA MACROS" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to excel-macros+unsubscr...@googlegroups.com.
>> To post to this group, send email to excel-macros@googlegroups.com.
>> Visit this group at http://groups.google.com/group/excel-macros.
>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
>> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
>> https://www.facebook.com/discussexcel
>>
>> FORUM RULES
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>> will not get quick attention or may not be answered.
>> 2) Don't post a question in the thread of another member.
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>> 4) Acknowledge the responses you receive, good or bad.
>> 5) Jobs posting is not allowed.
>> 6) Sharing copyrighted material and their links is not allowed.
>>
>> NOTE : Don't ever post confidential data in a workbook. Forum owners and
>> members are not responsible for any loss.
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "MS EXCEL AND VBA MACROS" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to excel-macros+unsubscr...@googlegroups.com.
>> To post to this group, send email to excel-macros@googlegroups.com.
>> Visit this group at http://groups.google.com/group/excel-macros.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.

Reply via email to