Convert "Month" to "MonthName" format from db to PivotTable

B

Billabong

Anyone who can help me with this,

I have this problem and this is the screnario:

On a pivot table ("Pivot1") the ColumnField ("Month") refers to a dat
with Month format (1-12). I would like to retrieve the data to
MonthName format ("mmm"). My code goes like this but doesn't work:

With .PivotFields("Month")
.Subtotals = Array(False, False, False, False, False, False
False, False, False, False, False, False)
.PivotItems("(blank)").Visible = False
.AutoSort xlAscending, "Month"
.function = format(Monthname( ,true),"mmm")

End With


Thanks and more power!!
 
B

Bob Phillips

Try something like

Format(DateSerial(Year(Date),Month,1),"mmm")

where month is the variable value.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top