Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default format numeric data in pivot table

I just created program to make pivot table.

How can I format the 'numbers' part of the pivot table to be comma
delineated with two significant digits after the period?

Note, I'm not even sure how to select just the 'data' part of the pivot table.
--
Richard
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default format numeric data in pivot table

Here is all you do:
right-click inside the pivot-table. Select PivotTable Wizard. Then select
Layout. Then select the Item in the Data area of the resulting layout
screen. Double-click it and then click the Number button. Check the 1,000
separator box (comma).

That is it!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default format numeric data in pivot table

Mike,
I need to do this in the macro that created the pivot table.
So I can't right-click inside of the data.
--
Richard


"Mike H." wrote:

Here is all you do:
right-click inside the pivot-table. Select PivotTable Wizard. Then select
Layout. Then select the Item in the Data area of the resulting layout
screen. Double-click it and then click the Number button. Check the 1,000
separator box (comma).

That is it!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default format numeric data in pivot table

Mike,
I need to do this in the macro that created the pivot table.
So I can't right-click inside of the data.

--
Richard


"Mike H." wrote:

Here is all you do:
right-click inside the pivot-table. Select PivotTable Wizard. Then select
Layout. Then select the Item in the Data area of the resulting layout
screen. Double-click it and then click the Number button. Check the 1,000
separator box (comma).

That is it!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default format numeric data in pivot table

I don't think you can do it to the pivot table but if you select the columns
that the data resides in and format it within your macro and then add code to
the worksheet calc() function to reselect and reformat each time the pivot
table changes you can accomplish the same thing.

Here is how I did it recently:

'this function goes in the "ThisWorkbook" Objects List in the VBA editor

Public OutletVal As String

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
'put code in here to reformat the cells if the value of a "critical cell" in
the pivot-'table, outletval, changes.
if range("outletval").value<outletval then
'put code here
end if
End Sub


HTH


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default format numeric data in pivot table

Only problem with you solution is that every time I run my program I will get
a different number of rows.
I guess I cold just format a number of rows larger than I would likely
expect to ever create.
--
Richard


"Mike H." wrote:

I don't think you can do it to the pivot table but if you select the columns
that the data resides in and format it within your macro and then add code to
the worksheet calc() function to reselect and reformat each time the pivot
table changes you can accomplish the same thing.

Here is how I did it recently:

'this function goes in the "ThisWorkbook" Objects List in the VBA editor

Public OutletVal As String

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
'put code in here to reformat the cells if the value of a "critical cell" in
the pivot-'table, outletval, changes.
if range("outletval").value<outletval then
'put code here
end if
End Sub


HTH

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default format numeric data in pivot table

if you know your pivottable starts on row 5 you could do this:
let x=5
do while true
if cells(x,1).value="Grand Total" then 'pivottable total at bottom row...
exit do
end if
x=x+1
Loop

'now you know your pivot table goes from rows 5 - X.

"Richard" wrote:

Only problem with you solution is that every time I run my program I will get
a different number of rows.
I guess I cold just format a number of rows larger than I would likely
expect to ever create.
--
Richard


"Mike H." wrote:

I don't think you can do it to the pivot table but if you select the columns
that the data resides in and format it within your macro and then add code to
the worksheet calc() function to reselect and reformat each time the pivot
table changes you can accomplish the same thing.

Here is how I did it recently:

'this function goes in the "ThisWorkbook" Objects List in the VBA editor

Public OutletVal As String

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
'put code in here to reformat the cells if the value of a "critical cell" in
the pivot-'table, outletval, changes.
if range("outletval").value<outletval then
'put code here
end if
End Sub


HTH

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
In Office 07, how do I format my pivot table data? Razzberryzing Excel Worksheet Functions 1 September 7th 09 01:22 AM
Pivot Table Format from Source Data tommcbrny Excel Discussion (Misc queries) 0 February 6th 09 08:12 PM
Format Extracted Data from Pivot Table Martincito23 Excel Discussion (Misc queries) 2 October 26th 07 01:01 PM
Pivot Table format changes when data is refreshed Bendinblues Excel Discussion (Misc queries) 8 October 22nd 07 02:45 PM
Pivot Table Data format Little Penny Excel Programming 1 September 22nd 07 03:17 AM


All times are GMT +1. The time now is 11:47 PM.

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

About Us

"It's about Microsoft Excel"