ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Convert "Month" to "MonthName" format from db to PivotTable (https://www.excelbanter.com/excel-programming/307938-convert-month-monthname-format-db-pivottable.html)

Billabong

Convert "Month" to "MonthName" format from db to PivotTable
 
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!!

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


Bob Phillips[_6_]

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/





All times are GMT +1. The time now is 04:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com