View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Remove letters from a cell

On Sat, 2 Oct 2004 03:52:33 +0100, "Norman Jones"
wrote:

I like your Val idea, but would your sub not destroy formulae?


Yes, the SUB would destroy formulas.

But, not being certain of the setup or desires of the OP, I posted both a UDF
and a SUB.

I suppose another method of writing the sub, and still getting a similar
result, would be something like:

====================
Sub GetNum()
Dim c As Range
For Each c In Selection
If Val(c) < 0 Then c.offset(0,n) = Val(c)
Next c
End Sub
==================

where n is the offset to the column desired for the result.


--ron