+ Reply to Thread
Results 1 to 11 of 11

How to remove dot(s) .. or ... in front of text string, not in a middle

  1. #1
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    How to remove dot(s) .. or ... in front of text string, not in a middle

    Hello All,
    I'm loking for code to remove two dot or three dot in front of text string but not single dot in middle. If I use replace then it remove all dot.

    Exp:

    ..123 => 123
    ..abc => abc
    ...456 => 456
    ...def => def
    123.456 => 123.456
    ...123.456 => 123.456
    ..abc.123 => abc.123
    456789 => 456789

    Regards,
    tt3
    Last edited by tuongtu3; 09-23-2013 at 05:45 PM. Reason: Solved

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: How to remove dot(s) .. or ... in front of text string, not in a middle

    You could try this formula:

    =SUBSTITUTE(SUBSTITUTE(A1,"...",""),"..","")

    Hope this helps.

    Pete

  3. #3
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: How to remove dot(s) .. or ... in front of text string, not in a middle

    Hi Peter,
    Sorry, I missed one more condition as:

    .E456789 => E456789

    Regards,
    tt3

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: How to remove dot(s) .. or ... in front of text string, not in a middle

    Try this instead, then:

    =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE("."&A1,"....",""),"...",""),"..","")

    Hope this helps.

    Pete

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to remove dot(s) .. or ... in front of text string, not in a middle

    i think you need another . in there
    =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(".."&A1,".....",""),"....",""),"...",""),"..","")
    otherwise if there is no leading . it adds one
    eg
    456789 => 456789
    becomes
    .456789 => 456789
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

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

    Re: How to remove dot(s) .. or ... in front of text string, not in a middle

    Another;

    Please Login or Register  to view this content.

  7. #7
    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,938

    Re: How to remove dot(s) .. or ... in front of text string, not in a middle

    THis may be a long way round, but maybe Text-to-Columns, and then re-combine those that you need to be combined?
    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

  8. #8
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: How to remove dot(s) .. or ... in front of text string, not in a middle

    Thank you very much for all your help,
    @FD: I prefer Macro
    @Peter: it work and also create extra (.) at blank cell (but also delete 0 in front)
    @John & Martin: it work (but also delete 0 in front)
    let says: ..0448123 => 448123 and how to keep 0 in front?

    Regards,
    tt3
    Last edited by tuongtu3; 09-23-2013 at 04:48 PM.

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to remove dot(s) .. or ... in front of text string, not in a middle

    doesn't remove 0 when i do it
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: How to remove dot(s) .. or ... in front of text string, not in a middle

    Hi Martin:
    I was using the .value = .Value so it omitted the 0 infront .Now I use Paste Special then solved the problem. Thank you very much for all your time and help.

    Regards,
    tt3
    Last edited by tuongtu3; 09-23-2013 at 05:48 PM.

  11. #11
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: How to remove dot(s) .. or ... in front of text string, not in a middle

    @Martin,

    Probably due to the cell's number format.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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. Remove middle name for end of a name string
    By maacmaac in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-30-2022, 04:44 PM
  2. how to remove a character from the middle of text on all cells
    By webuxer in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-30-2013, 06:01 PM
  3. [SOLVED] if formula looking at value in middle of text string
    By SAsplin in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 04-25-2013, 06:57 AM
  4. remove non-existent space in front of text in excel
    By ewong in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-27-2012, 12:30 PM
  5. [SOLVED] pulling text from the middle of a string
    By DRFILL in forum Excel General
    Replies: 3
    Last Post: 09-21-2012, 11:35 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