Zero Default
Not as a default, but you could use an event macro that looks at the cell after
the change and if it's empty, it changes the cell to 0.
If you want to try, right click on the worksheet tab that should have that
behavior and select view code. Paste this into the code window that just
opened:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myCell As Range
Dim myRng As Range
Set myRng = Me.Range("a1:b99") 'whatever range should be checked
If Intersect(Target, myRng) Is Nothing Then Exit Sub
On Error Resume Next
Application.EnableEvents = False
For Each myCell In Intersect(Target, myRng).Cells
If myCell.Value = "" Then
myCell.Value = 0
End If
Next myCell
Application.EnableEvents = True
On Error GoTo 0
End Sub
Macros have to be enabled for this to work. And change the range (I used
A1:B99) to what you need.
Please help James wrote:
Is there any way that I can make each cell a zero default, so that whenever a
number is deleted within a cell, it reverts back to zero. Thanks!
--
Dave Peterson
|