View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Jean-Marc P Jean-Marc P is offline
external usenet poster
 
Posts: 7
Default Programming the filter of a pivot table

Manual filter (auto filer) works fine !?!? Doesn't seem to be the same pb

"KenY" wrote:

does your pivot table filter correctly if you filter manually?

Are your dates in the right format and are they properly recognised as Excel
dates? I am wondering if there is a link with the problem that I am
experiencing (see my post 'Texttocolumns and Date Format using Macro - UK
International setti ngs'
http://www.microsoft.com/office/comm...b-937ad3c07c79 )

--
KenY


"Jean-Marc P" wrote:

I just can't get through this ... I've spent hours on it & I'm sure it's very
simple !!

I download a (.txt) file with tons dates of events in it. Once this is done,
i run a macro that does numerous things, including filter the list & then
refresh the pivot table. Info that have been filtered in the list still
appear in the pivot table. How can I get rid of them ? (I join the part of
the code where I filter & refresh)

'filter the list to get the next 4 months
Selection.AutoFilter Field:=9, Criteria1:="=today()", Operator:=xlAnd _
, Criteria2:="<=TODAY()+122"
'refresh the pivottable
Sheets("Dynamique").Select
ActiveSheet.PivotTables("Tableau croisé dynamique2").PivotCache.Refresh

Please help me !!