View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim Feaver Jim Feaver is offline
external usenet poster
 
Posts: 16
Default assign number value

Hi Tim:
This worksheet_change event procedure works for column K.
Adjust the isect range to whatever column(s) you need..

Private Sub Worksheet_Change(ByVal target As Range)
Dim isect As Range, c As Range
On Error GoTo Cleanup

Set isect = intersect(target, Range("K:K"))
If Not (isect Is Nothing) Then
Application.EnableEvents = False
For Each c In isect
If c.Value < "" Then
c.Value = 0
End If
Next c
End If

Cleanup:
Application.EnableEvents = True
End Sub

hth,
Jim Feaver

"Tim" wrote in message
...
I would like to make a column reject anything other than a number for the

column. If a word is put in there by a macro excel sees it is not a number
and replaces it with a 0 or blank.