View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Mike H. Mike H. is offline
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