Erase numeric digits only

  • Thread starter Thread starter an
  • Start date Start date
A

an

Hello!

I have an alphanumeric column data with:

nnnTEXT
nnnnnTEXT
nTEXT
nnTEXT
....

Where n=numeric digits

In column, I need to erase all numeric digits, to TEXT.
Is it possible with Excel Function?

Thanks in advance.
an
 
Hi
if the numbers always start at the beginning try the following array
formula (entered with CTRL+SHIFT+ENTER):
=MID(A1,MAX(IF(ISNUMBER(--MID(A1,ROW(INDIRECT("1:1024")),1)),ROW(INDIRE
CT("1:1024"))))+1,1024)
 
Ok, FK.

Work OK!
Many thanks.
an
-----Original Message-----
Hi
if the numbers always start at the beginning try the following array
formula (entered with CTRL+SHIFT+ENTER):
=MID(A1,MAX(IF(ISNUMBER(--MID(A1,ROW(INDIRECT ("1:1024")),1)),ROW(INDIRE
CT("1:1024"))))+1,1024)

--
Regards
Frank Kabel
Frankfurt, Germany



.
 
One way:

Public Function DeleteNumbers(ByVal sIn As String) As String
Dim i As Long
If sIn Like "*[0-9]*" Then 'only process if numbers
For i = 1 To Len(sIn)
If Mid(sIn, i, 1) Like "[!0-9]" Then
DeleteNumbers = DeleteNumbers & Mid(sIn, i, 1)
End If
Next i
Else
DeleteNumbers = sIn
End If
End Function

If you don't know much about UDF's see David McRitchie's "Getting
Started with Macros and User Defined Functions":

http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Faster...

=SUBSTITUTE(A1,LEFT(A1,SUMPRODUCT((LEN(A1)-LEN(SUBSTITUTE(A1,{0,1,2,3,4,5,6,
7,8,9},""))))),"")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top