+ Reply to Thread
Results 1 to 4 of 4

Excel 2007 : Removing extra space from cell content between words

Hybrid View

  1. #1
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Removing extra space from cell content between words

    Try this
    For one space
    =TRIM(A2)

    For two spaces
    =SUBSTITUTE(TRIM(A2)," ",REPT(" ",2),1)
    If you omit the last arguement from the above i.e. ,1 then all spaces will be replaced with double spaces, change it to ,2 and the second space will be doubled...etc

    Trim as a worksheet function removes all extra spaces in a string, unlike the VBa Trim which only removes leading and trailing spaces.

    Hope this helps
    Attached Files Attached Files
    Last edited by Marcol; 02-26-2011 at 03:34 PM. Reason: Typos
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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