Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel2007 VBA - dates in Pivot Tables not read in correct format
If I create a PivotTable with a field called DATE containing dates formatting
as dd/mm/yy, I then use this macro to remove Saturdays and Sundays from the PivotTable. Except it reads the dates a mm/dd/yy until they are 'out of scope' and then they are read as dd/mm/yy. Why? Sub HideWeekendsFromPivotTable() Dim pivotName As String Dim pivotDate As Date Dim z, pivotCount As Long pivotName = ActiveSheet.PivotTables(1).Name With ActiveSheet.PivotTables(pivotName).PivotFields("Da te") pivotCount = .PivotItems.Count For z = 1 To pivotCount If Weekday(.PivotItems(z).Name) = 1 Or Weekday(.PivotItems(z).Name) = 7 Then _ .PivotItems(z).Visible = False Next z End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pivot Chart Dates not in correct order | Charts and Charting in Excel | |||
my pivot tables are correct but my totals and GT don't show | Excel Discussion (Misc queries) | |||
Anyone seen Pivot Tables with incorrect detail but correct total? | Excel Discussion (Misc queries) | |||
Why do pivot tables not read numbers that are copied and pasted | Excel Discussion (Misc queries) | |||
pivot table dates are out of order how do I correct them | Excel Worksheet Functions |