• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Pivot table variable problem

van_65166

New Member
Hello

Is it possible to make the date part variable in the vba code below? I would like your help.

>>> use code - tags <<<
Code:
ActiveSheet.PivotTables("PivotTable1").PivotFields("Yaratma tarihi"). _
PivotFilters.Add2 Türü:=xlBefore, Değer1:="20.01.2025"
sample file


 
Last edited by a moderator:

van_65166

It's many time smoother for others to send an Excel-file here than link to somewhere.

HELLO, DON'T HOLD IT AGAINST ME, I WILL BE MORE CAREFUL, GOOD LUCK
Moderator Note: Please check that Your CapsLock-button works well. Only capital letters means shouting.
 

Attachments

  • TEST KİTAP.xlsm
    61 KB · Views: 2

van_6516

Your sample file misses 'Pivottable1'.
You could try to modify Your code like below.
ActiveSheet.PivotTables("PivotTable1").PivotFields("Yaratma tarihi").PivotFilters.Add2 Türü:=xlBefore, Değer1:= date1
... and You have to add one more line before above line - which gives value for date1
 
Back
Top