Re: Old question new twist?



You don't need to put the code in each workbook. Eg place in a dedicated
workbook, your personal.xls, some addin, why not in the same project as you
are running your VBA to do the update stuff.

Regards,
Peter T



"URW" <URW@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:8BA428E3-73F8-4108-A1EE-7D1A05198313@xxxxxxxxxxxxxxxx
Hi all,

I am new to VBA and Excel programming and have come across the old problem
of hiding 0's in cells with formulas. I know I can unset the zero values
option, but I need to do this to 2 sheets in some 50 workbooks, so I want
to
do this in code. The workbooks are updated every so often using an Access
database and VBA and the 2 sheets I am dealing with are added to each
during
the update process. I tried using

Application.ActiveWindow.DisplayZeros = False

but that gives me a Macro security warning when the file is opened and I
don't want that, nor do I want to reduce the security to low to get around
the warning.

I tried using a format string, setting the numberFormat propery for the
cells in question to "#,##0_);(#,##0)" but that only works for cells
without
a formula.

Now I am stuck and don't know what else to try. I have found all kinds of
solutions on the web, but they all involve setting something in Excel
which I
don't want to do, because I would have to do it in 50 or so workbooks.

Does anyone here know how to hide zeros in a cell with a formula in VBA
code?

The formula is just a summation to total the values in the column, if that
makes a difference.

If you have some ideas you are willing to share or know for sure this
can't
be done, please reply to my post. I would be very appreciative for the
help.

Thanks

URW


.


Loading