Re: Erase numeric digits only

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: JE McGimpsey (jemcgimpsey_at_mvps.org)
Date: 05/26/04


Date: Wed, 26 May 2004 10:31:46 -0600

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

In article <12e9001c4433b$4a2ed090$a501280a@phx.gbl>,
 "an" <anonymous@discussions.microsoft.com> wrote:

> 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



Relevant Pages

  • Re: Erase numeric digits only
    ... if the numbers always start at the beginning try the following array ... Frank Kabel ... > I have an alphanumeric column data with: ... > In column, I need to erase all numeric digits, to TEXT. ...
    (microsoft.public.excel.misc)
  • Erase numeric digits only
    ... I have an alphanumeric column data with: ... nnTEXT ... In column, I need to erase all numeric digits, to TEXT. ...
    (microsoft.public.excel.misc)