+ Reply to Thread
Results 1 to 2 of 2

Looking for a way to find and replace just letters in a regex style manner

  1. #1
    Registered User
    Join Date
    06-20-2012
    Location
    Earth
    MS-Off Ver
    Excel 2010
    Posts
    15

    Question Looking for a way to find and replace just letters in a regex style manner

    EDIT: Title shouldn't really say "Just letters", I'd like to find and replace everything that isn't a number.

    Hello all,

    I'm a frequent user of Python and this task would be fairly simple using the regex library however this is rising some challenges in excel. In Python I could just use a substitute function like so: re.sub(Pattern, Replacement, String) and substitute all letters with "".

    However, in VBA there appears to be no regular expression library.

    I have line items that looks like this: "account_23234232434 expenses", I would like to just substitute all non-digits for "" and have only "23234232434" remain. The numbers and words can be longer or shorter so using something like =left(right("account_23234232434 expenses", N), N) doesn't really work.

    I know there is a replace function n VBA that I have used before but as far as I know it doesn't facilitate what I'm looking for.

    Any solutions or suggestions?
    Last edited by Wegener; 08-13-2013 at 01:57 PM.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Looking for a way to find and replace just letters in a regex style manner

    Look here?

    http://www.extendoffice.com/document...haracters.html

+ 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] Find and Replace a Style
    By Jim Bennett in forum Excel General
    Replies: 6
    Last Post: 11-05-2019, 12:36 AM
  2. Find and Replace when there are two of the same letters
    By amartino44 in forum Excel General
    Replies: 1
    Last Post: 03-17-2013, 06:23 PM
  3. Creating a macro using the RegEx Find/Replace add-in
    By bauman312 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-24-2012, 12:52 PM
  4. Search and replace(Regex) in string in array.
    By VBABen in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-22-2011, 09:21 AM
  5. Help with complex find and replace style function
    By Snowtoad in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-25-2010, 11:33 PM

Tags for this Thread

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