0

If a worksheet does not exist, I create a new worksheet wit the command

Sheets.Add After:=Sheets(Sheets.count).

I don't want to see the zero values in these sheets but don't know how to do this in VBA. I want to do this with a VBA instruction.

Chielmos
  • 65
  • 1
  • 2
  • 7
  • 1
    What do you mean with "the zero values"? – pizzettix Jan 30 '21 at 13:58
  • If the value in a cell is "0", then this value is displayed. What I want is that if the value is zero (0), that the cell is left blank. I can change that for each worksheet in "Options", but I want to set this for each sheet I create to set this in VBA. – Chielmos Jan 30 '21 at 14:10
  • 2
    What you are describing is a property of a [worksheet view](https://stackoverflow.com/q/34028720/11683), not the worksheet itself. Although you can "truly" hide zeroes in all views by applying a corresponding [numeric format](https://stackoverflow.com/a/32172418/11683). – GSerg Jan 30 '21 at 15:32
  • GSerg, thank you very much for your help. This is the solution for me. – Chielmos Jan 31 '21 at 10:59

1 Answers1

0

You can use this to show zeros as blanks.

ActiveWindow.DisplayZeros = False
norie
  • 9,609
  • 2
  • 11
  • 18