+ Reply to Thread
Results 1 to 4 of 4

Replace function in Excel

  1. #1
    Registered User
    Join Date
    05-21-2008
    Posts
    1

    Replace function in Excel

    Hi i have a column in excel sheet with data like ab-34-50-121.
    I want to make it ab3450121 i.e. i want to remove '-'. I have like 400 rows in that column.
    Is this possible in excel 2003 to do this.
    I would greatly appreciate any input on this

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Select the column or range. Press Ctrl + H > in the find box enter - and leave the replace box blank

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441
    Can you not use Replace, CTRL+H
    Select the column first then CTRL+H to bring up the dialog.

    Finding "-". Replace with nothing
    Cheers
    Andy
    www.andypope.info

  4. #4
    all4excel
    Guest

    Smile Using Find and Replace to remove "-".

    Ravi,

    You can try this formula option, if you dont want to use Cntrl + H and Replace..

    [ = REPLACE(REPLACE(REPLACE(B2,FIND("-",B2,1),1,),FIND("-",REPLACE(B2,FIND("-",B2,1),1,),1),1,),FIND("-",REPLACE(REPLACE(B2,FIND("-",B2,1),1,),FIND("-",REPLACE(B2,FIND("-",B2,1),1,),1),1,),1),1,) ]

    Considering that your values are in B2 just paste this solution in C2.

    Let me know if u need any more help
    Last edited by all4excel; 05-22-2008 at 02:21 AM.

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Quote Originally Posted by all4excel
    Ravi,

    You can try this formula option, if you dont want to use Cntrl + H and Replace..

    [ =REPLACE(REPLACE(REPLACE(REPLACE(B2,FIND("-",B2,1),1,),FIND("-",REPLACE(B2,FIND("-",B2,1),1,),1),1,),FIND("-",REPLACE(REPLACE(B2,FIND("-",B2,1),1,),FIND("-",REPLACE(B2,FIND("-",B2,1),1,),1),1,),1),1,),FIND("-",REPLACE(B2,FIND("-",REPLACE(REPLACE(B2,FIND("-",B2,1),1,),FIND("-",REPLACE(B2,FIND("-",B2,1),1,),1),1,),1),1,),1),1,) ]

    Considering that your values are in B2 just paste this solution in C2.

    Let me know if u need any more help
    Just use

    =SUBSTITUTE(A1,"-","")
    VBA Noob

  6. #6
    all4excel
    Guest

    Smile That's more compact and robust..!

    Quote Originally Posted by VBA Noob
    Just use


    VBA Noob
    Ravi,

    I think Noobs formula is more efficient in terms of complexity and memory space...

    Moreover it can help you trim the "-" to any extent..

+ 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