View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default assign number value

Tim,

This works on column 1

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
On Error GoTo ws_exit
With Target
If .Column = 1 Then
If Not IsNumeric(.Value) Then
.Value = ""
End If
End If
End With

ws_exit:
Application.EnableEvents = True
End Sub


Put it in the appropriate worksheet code module.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"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.