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


 
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 do I assign a number to a name in another column? Michelle Excel Worksheet Functions 0 September 24th 09 10:16 PM
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
assign number value Bob Phillips[_6_] Excel Programming 0 February 5th 04 07:24 PM


All times are GMT +1. The time now is 05:34 AM.

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"