Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to specify a cell format for pivot data field?


Hi!

I am using vba to create pivot table via ADO using data from access db
Here is my data field


objMyPivotTable.PivotFields("Salary").Orientation
xlDataField


If I would like my data field has the format of "#, ##0" - that mean
no decimal, I am not sure how should I do that?

Please advise.

Aijun

--
Ai_Jun_Zhan
-----------------------------------------------------------------------
Ai_Jun_Zhang's Profile: http://www.excelforum.com/member.php...fo&userid=2547
View this thread: http://www.excelforum.com/showthread.php?threadid=47007

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default How to specify a cell format for pivot data field?

Have you tried:

objMyPivotTable.PivotFields("Salary").NumberFormat = "#,##0"

Regards
Rowan

Ai_Jun_Zhang wrote:
Hi!

I am using vba to create pivot table via ADO using data from access db.
Here is my data field


objMyPivotTable.PivotFields("Salary").Orientation =
xlDataField


If I would like my data field has the format of "#, ##0" - that means
no decimal, I am not sure how should I do that?

Please advise.

Aijun.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to specify a cell format for pivot data field?


Hi! Rowan,

I tried that and it did not work.

Thanks,

Aijun.


--
Ai_Jun_Zhang
------------------------------------------------------------------------
Ai_Jun_Zhang's Profile: http://www.excelforum.com/member.php...o&userid=25474
View this thread: http://www.excelforum.com/showthread...hreadid=470074

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to specify a cell format for pivot data field?


Hi! Rowan,

I figured it out. It has to add "sum of" before the Salary

objMyPivotTable.PivotFields("sum of " + "Salary").NumberFormat =
"#,##0"


Thanks,

Aijun.


--
Ai_Jun_Zhang
------------------------------------------------------------------------
Ai_Jun_Zhang's Profile: http://www.excelforum.com/member.php...o&userid=25474
View this thread: http://www.excelforum.com/showthread...hreadid=470074

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot 2007. Format row field Hennie[_2_] Excel Discussion (Misc queries) 0 November 2nd 09 12:02 AM
Pivot Field in Field List but Not Source Data AP[_2_] Excel Discussion (Misc queries) 0 November 1st 07 04:06 PM
Missing Pivot Data in Pivot Field (PF)-Weird! [email protected] Excel Discussion (Misc queries) 5 May 17th 07 06:29 AM
Pivot Table Row Field Format (OLAP Source) Adrian Morris Excel Discussion (Misc queries) 2 December 16th 05 10:37 AM
determine cell is part of pivot item or pivot field isskiran Excel Programming 3 December 8th 03 07:18 PM


All times are GMT +1. The time now is 04:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"