View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Convert "Month" to "MonthName" format from db to PivotTable

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)

"Billabong " wrote in message
...
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 data
with Month format (1-12). I would like to retrieve the data to a
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!!!


---
Message posted from http://www.ExcelForum.com/