Tom Urtis
MrExcel MVP
- Joined
- Feb 10, 2002
- Messages
- 11,300
OK, I'm having a brain block regarding cell formatting, and (believe it or not) I'm trying to avoid using VBA if possible to accomplish the kind of formatting I need. I want to have empty cells display a zero, and I'm probably forgetting something simple about how to do it.
Background:
I have a range of empty cells in A1:M20. "Empty cells" means no formulas, values, or formatting of any kind...cells that are in untouched condition just as when you start a new workbook.
I am creating a budget workbook model, where cells in A1:M20 might have whole numbers manually entered into them. No text or decimal places are involved.
Not every cell will end up having a number manually entered into it. When it does, the range shall be formatted for comma separators, such as you'd get with the #,##0;-#,##0 custom format. No problem so far.
The question I have is, when no number otherwise exists in a cell (either because the cell has never been touched, or its previous number was deleted), what would be the custom format to display a zero ("0") in that cell? The client wants to see every cell contain either whole numbers (formatted for comma separators), or a zero.
I could put code in the worksheet module to display a zero in cells with a zero-length string, but is there a native custom format to achieve this?
Background:
I have a range of empty cells in A1:M20. "Empty cells" means no formulas, values, or formatting of any kind...cells that are in untouched condition just as when you start a new workbook.
I am creating a budget workbook model, where cells in A1:M20 might have whole numbers manually entered into them. No text or decimal places are involved.
Not every cell will end up having a number manually entered into it. When it does, the range shall be formatted for comma separators, such as you'd get with the #,##0;-#,##0 custom format. No problem so far.
The question I have is, when no number otherwise exists in a cell (either because the cell has never been touched, or its previous number was deleted), what would be the custom format to display a zero ("0") in that cell? The client wants to see every cell contain either whole numbers (formatted for comma separators), or a zero.
I could put code in the worksheet module to display a zero in cells with a zero-length string, but is there a native custom format to achieve this?