+ Reply to Thread
Results 1 to 5 of 5

About Wildcards> How to subscript the digits only of a string such as N12 or D3

  1. #1
    Forum Contributor
    Join Date
    01-08-2013
    Location
    ankara
    MS-Off Ver
    Excel 2010
    Posts
    134

    About Wildcards> How to subscript the digits only of a string such as N12 or D3

    Hi

    I have a text like this.

    (N5-N56)/D50
    = 5,658848 (N56-N60)/D50
    = 3,307378 (N60-N63)/D50
    = 2,225554 (N63-N65)/D50
    = 1,358529 (N65-N76)/D50
    = 5,533397
    39.767,60 28.645,20 19.275,52 11.766,22 67.094,65

    I want to select all text and subscript any digit of 1 or 2 characters (these are ages) that's followed by D or N by a single click using wildcards.

    Please Login or Register  to view this content.
    My code above makes the D and N characters to subscript as well. (So I need a second correction to make them big again).
    \2 to the second box removes D and N terms. I have to keep them unchanged.

    I just obsessed with this but couldn't find a way.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: About Wildcards> How to subscript the digits only of a string such as N12 or D3

    Is this a word or excel question?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    01-08-2013
    Location
    ankara
    MS-Off Ver
    Excel 2010
    Posts
    134

    Re: About Wildcards> How to subscript the digits only of a string such as N12 or D3

    Quote Originally Posted by FDibbins View Post
    Is this a word or excel question?
    Sorry, I couldn't express myself clearly.
    This is a word question about using wildcards for find/replace though I copy and paste the data from excel. I just wondered if there is a single line code for that.
    Find: ([DN])([0-9]{2})
    Replace: \1\2 subscript format

    I need to tell something into replace box for \1 term to remain unchanged.

  4. #4
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: About Wildcards> How to subscript the digits only of a string such as N12 or D3

    You can't apply a different format to only part of a Find/Replace string - you would have to use a Find/Replace that superscripts the entire replacement (e.g. iteratively search through just the numbers) or use a macro.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  5. #5
    Forum Contributor
    Join Date
    01-08-2013
    Location
    ankara
    MS-Off Ver
    Excel 2010
    Posts
    134

    Re: About Wildcards> How to subscript the digits only of a string such as N12 or D3

    Oh I see, thank you for the information

+ 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] Picking out text from within a string - Possibly using wildcards?
    By Houthakker in forum Excel General
    Replies: 9
    Last Post: 12-09-2017, 01:24 AM
  2. [SOLVED] Add digits to make string 10 digits
    By jscalem in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-14-2016, 05:55 PM
  3. [SOLVED] Subscript character in VBA String
    By Bob1980 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-29-2013, 05:44 PM
  4. Using wildcards in VBA to check string contents in If...Then statement
    By shennin202 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-10-2013, 03:45 PM
  5. How to use wildcards with a string in VBA
    By rafa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-20-2011, 08:30 AM
  6. IF Function wildcards for # of digits in value?
    By robinbird in forum Excel General
    Replies: 1
    Last Post: 12-02-2008, 04:53 PM
  7. string compare with wildcards
    By Marcus Hoffmann in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-26-2005, 07:06 AM

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