+ Reply to Thread
Results 1 to 4 of 4

How do you get rid of one character?

  1. #1
    Forum Contributor
    Join Date
    05-01-2006
    Location
    Erie, Pa USA
    MS-Off Ver
    Vista - Excel 2003
    Posts
    132

    How do you get rid of one character?

    In a cell that has varying number of characters, how do you get rid of the number or letter on the right.

    For instance: 10d needs to read 10, 109d needs to read 109, 5d needs to read 5.

    Thanks in advance.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    For a value in A1

    If the numbers will always be the final characters in the cell contents, try
    this:
    B1: =MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),99)*1


    Note: that formula returns an error if there are no numbers in the cell


    This formula finds numbers anywhere in the cell (returns zero if none):
    B1:
    =LOOKUP(99^99,--("0"&MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789*")),ROW($1:$10000))))

    Note: in case text wrap impacts the display, there are no spaces in those
    formulas.

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Contributor
    Join Date
    06-23-2004
    Location
    Houston, TX
    Posts
    571
    Quote Originally Posted by HBF
    In a cell that has varying number of characters, how do you get rid of the number or letter on the right.

    For instance: 10d needs to read 10, 109d needs to read 109, 5d needs to read 5.

    Thanks in advance.
    Try this ...

    =left(A1,len(A1)-1)
    BenjieLop
    Houston, TX

  4. #4
    Registered User
    Join Date
    11-26-2004
    Posts
    34
    ASAP utilities has a comand that will do that for you in their Text submenue called "delete all text characters in selection"

+ 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