Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I assign a different value to a number (for ranking)? rustyuser58 Excel Discussion (Misc queries) 4 November 6th 09 04:11 PM
Assign a number to a word Noob McKnownowt Excel Worksheet Functions 5 September 16th 08 11:39 AM
Can I assign a number to a name and use the name in a sum? beeno Excel Discussion (Misc queries) 1 July 11th 06 10:47 PM
Assign one number to a number range Sue New Users to Excel 1 October 6th 05 01:21 AM
Assign a number to a name Sukismomma Excel Worksheet Functions 4 March 3rd 05 07:49 PM


All times are GMT +1. The time now is 10:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"