View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
mrice
 
Posts: n/a
Default I want to remove alphas from within a number.


I would suggest a user defined function which sequentially substitutes
that characters with nothing.


Function RemoveAlphas(Cell)
TestString = Cell.Value
For N = Len(Cell) To 1 Step -1
If Asc(Mid(TestString, N, 1)) < 48 Or Asc(Mid(TestString, N, 1))
57 Then
TestString = Left(TestString, N - 1) & Right(TestString,
Len(TestString) - N)
End If
Next N
RemoveAlphas = TestString
End Function

Martin

http://homepage.ntlworld.com/martin.rice1/


--
mrice
------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=532039