ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Document properties (https://www.excelbanter.com/excel-programming/304526-re-document-properties.html)

Rob Bovey

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 *





All times are GMT +1. The time now is 02:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com