LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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

 
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 06:56 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"