+ Reply to Thread
Results 1 to 3 of 3

I want to remove alphas from within a number.

  1. #1
    SakDaddy
    Guest

    I want to remove alphas from within a number.

    If I have a column of numbers that have 123a4b5c and I want to remove the
    "abc" so that the change reads 12345, what is the function I use?

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Macro

    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/

  3. #3
    Duke Carey
    Guest

    RE: I want to remove alphas from within a number.

    Are 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("123a4b5c",3)&mid("123a4b5c" 5,1)&midmid("123a4b5c" 7,1))





    "SakDaddy" wrote:

    > If I have a column of numbers that have 123a4b5c and I want to remove the
    > "abc" so that the change reads 12345, what is the function I use?


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1