Anybody know an easy way to group the date in a Pivottable with VBA? Right now all I can find is I have to select the column name or one of the dates and then group it. Is there an easier way?
Daniel
Printable View
Anybody know an easy way to group the date in a Pivottable with VBA? Right now all I can find is I have to select the column name or one of the dates and then group it. Is there an easier way?
Daniel
This appears to work:
[VBA]
Dim pf As PivotField
Set pf = pt.PivotFields("Date")
pf.LabelRange.Group Start:=7306, End:=73051, Periods:=Array(False, False, False _
, False, True, False, True)
[/VBA]
In my limited testing, that grouped my date field into years and months, with really wide boundaries for the start/end dates.
Thank you that worked perfectly