View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Bovey Rob Bovey is offline
external usenet poster
 
Posts: 811
Default Document properties

"John Beschler" wrote in message
...
I am trying to change the option to show/not show zero valuesin an excel

workbook (or sheet) in VB 6.0. Can anyone point me in the right direction?
I've searched MSDN and google both, to no avail.

Hi John,

The property that controls this is a property of the Window object.
Therefore, unless you have a workbook with only a single worksheet, you need
to loop through each worksheet in the workbook, activate it, then turn off
the DisplayZeros property through the Window object. The code would look
something like this:

Dim wkbBook As Excel.Workbook
Dim wksSheet As Excel.Worksheet

''' Set a reference to you workbook here.

For Each wksSheet In wkbBook.Worksheets
wksSheet.Activate
wkbBook.Windows(1).DisplayZeros = False
Next wksSheet

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *