trick similar to Excel where you can change the number format to use colors
and specify that the cell text is white (to match the cell background color
which gives it the look of a blank cell).
For example, here's a code snippet where you can set the number format code
and color for [positive;negative;zero] values. The number format color
overrides the font color; so anything that's not a number, like an error,
will display in the font color.
To try this, modify the connection string to use your server and enter a
divisor (a divisor of zero will display an error in the calculated total):
PivotTable1.ConnectionString = _
"Provider=MSOLAP.2;Integrated Security=SSPI;Data
Source=YourServer;Initial Catalog=FoodMart 2000"
PivotTable1.DataMember = "Sales"
Dim pt As PivotTotal
Dim divisor As Integer
divisor = InputBox("Divisor")
Set pt = PivotTable1.ActiveView.AddCalculatedTotal("Test", "Test", "1/"
& divisor)
With PivotTable1.ActiveView
.RowAxis.InsertFieldSet .FieldSets("Customers")
.DataAxis.InsertTotal pt
pt.NumberFormat = "[Black]0.00;[Red]-0.00;[Black]0;"
.TotalFont.Color = "White"
End With
Hope this helps!
Lori Turner
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "Lucas" <
[email protected]>
Subject: OWC 11 - How to change #VALUE display
Date: Fri, 2 Jan 2004 10:25:04 -0300
Lines: 11
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <
[email protected]>
Newsgroups: microsoft.public.office.developer.web.components
NNTP-Posting-Host: lan-152-107.easymail.net.ar 200.80.152.107
Path: