If I have a column of numbers that have 123a4b5c and I want to remove the
quot;abcquot; so that the change reads 12345, what is the function I use?
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)) lt; 48 Or Asc(Mid(TestString, N, 1)) gt;
57 Then
TestString = Left(TestString, N - 1) amp; Right(TestString,
Len(TestString) - N)
End If
Next N
RemoveAlphas = TestString
End Function
Martin
homepage.ntlworld.com/martin.rice1/--
mrice
------------------------------------------------------------------------
mrice's Profile: www.excelforum.com/member.php...oamp;userid=10931
View this thread: www.excelforum.com/showthread...hreadid=532039Are all your text values laid out the same:
3 digits, 1 alpha, 1 digit, 1 alpha, 1 digit, 1 alpha?
If so, then use
=value(left(quot;123a4b5cquot;,3)amp;mid(quot;123a4b5cquot; 5,1)amp;midmid(quot;123a4b5cquot; 7,1))quot;SakDaddyquot; wrote:
gt; If I have a column of numbers that have 123a4b5c and I want to remove the
gt; quot;abcquot; so that the change reads 12345, what is the function I use?
- Dec 18 Mon 2006 20:34
I want to remove alphas from within a number.
close
全站熱搜
留言列表
發表留言