+ Reply to Thread
Results 1 to 3 of 3

Ignore non-numeric characters in a string

  1. #1
    Forum Contributor
    Join Date
    02-26-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    173

    Ignore non-numeric characters in a string

    Hello and thank you for looking at my thread.

    I am looking for a way to make excel ignore non-numeric characters in a string.

    I have a line similar to
    Please Login or Register  to view this content.
    where cell is an array (Dim as Range) with a number. Sometimes that number contains a letter which breaks my macro. Is there any easy way to strip non-numeric characters?

    eg; Have it treat a variable that could either have the value 1234 or 1234a as 1234. (And 1234 could be any number under 9999)

    Thanks in advance!

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Ignore non-numeric characters in a string

    If the letters are always after the number, you could Val():
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Contributor
    Join Date
    02-26-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    173

    Re: Ignore non-numeric characters in a string

    Thank you tigeravatar! Lucky for me, the letters are always after the numbers. Val() did the job great!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Sum of numeric values within cells also containing non-numeric characters
    By Mike Brewer in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 04-24-2013, 09:16 AM
  2. Replies: 4
    Last Post: 06-21-2012, 11:34 AM
  3. ignore last 18 characters & use as search string
    By SarahPintal in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-18-2010, 12:27 AM
  4. Deleting all non-numeric characters in a text-string?!
    By Cygnos in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-01-2008, 06:50 AM
  5. Replies: 1
    Last Post: 01-31-2005, 01:03 PM

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