+ Reply to Thread
Results 1 to 7 of 7

[SOLVED] Macro/Wildcard to remove only numbers excluding text with numbers

  1. #1
    Registered User
    Join Date
    06-18-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    16

    [SOLVED] Macro/Wildcard to remove only numbers excluding text with numbers

    Hi Team,

    I am stuck with one wild card

    There is one wild card which removes numbers from document ^# but it removes numbers also which have text with it.

    I want wildcard or macro which removes only standalone numbers not numbers with text

    Ex:

    if its number like 1.00.111 or 1,00,000 then it should be removed

    but if numbers are like interest 10% then it should not be removed.

    I have added an example doc for the same
    Attached Files Attached Files
    Last edited by indianhp; 06-21-2013 at 08:14 AM.

  2. #2
    Registered User
    Join Date
    05-10-2013
    Location
    Pomáz, Hungary
    MS-Off Ver
    Excel 2007
    Posts
    78

    Re: Macro/Wildcard to remove only numbers excluding text with numbers

    Insert this code into a module, at Tools/References check Microsoft VBScript Regular Expressions 5.5, and use this in the next column as a User Defined Function:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-18-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Macro/Wildcard to remove only numbers excluding text with numbers

    Hi Istvan,

    Can i have same functionalty for word also?... or can i use it in word also...

  4. #4
    Registered User
    Join Date
    05-10-2013
    Location
    Pomáz, Hungary
    MS-Off Ver
    Excel 2007
    Posts
    78

    Re: Macro/Wildcard to remove only numbers excluding text with numbers

    Hi indianhp,

    In Word I would do this:

    Select the table, go to Table/Convert/Convert Table to Text, choose paragraph marks as the delimiter.
    Then go to Edit/Find and Replace, check Wildcard (or sth like this) checkbox and:

    Find: (^13[0-9.,]{1;})
    Replace with: ^p

    Because of the different country settings, in the Find box you may have to use comma, instead of semicolon in the curly brackets.

    Select the text, go to Table/Convert/Convert Table to Text, choose 1 (number of columns) and paragraph marks (delimiter).

    Hope this works for you too.

  5. #5
    Registered User
    Join Date
    06-18-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Macro/Wildcard to remove only numbers excluding text with numbers

    Hi Istvan,

    Its working great on text part but most of the time i have data in tables. Which needs to be processed in such way... So can it updated to use it on tables and text portion both..???

    Other wise its works great for me. But if its works on table it will be much greater for me.

  6. #6
    Registered User
    Join Date
    05-10-2013
    Location
    Pomáz, Hungary
    MS-Off Ver
    Excel 2007
    Posts
    78

    Re: Macro/Wildcard to remove only numbers excluding text with numbers

    Hi indianhp,

    If the table in Word should be processed as table, I do not know a way to delete selectively the number-only lines. That is why I suggested a workaround where the table is converted to text > the necessary changes performed > then the changed text is converted back to table, with the goal achieved. This link proposes similar method to process tables in Word with a regex:

    http://office.microsoft.com/en-us/wo...001087304.aspx

  7. #7
    Registered User
    Join Date
    06-18-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Macro/Wildcard to remove only numbers excluding text with numbers

    Hi Istvan,

    Anyways its working fine in running text... Its good for me. Thanks for support.

+ 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