+ Reply to Thread
Results 1 to 6 of 6

How to detect extra space?

  1. #1
    Registered User
    Join Date
    08-03-2014
    Location
    Philippines
    MS-Off Ver
    Microsoft Office 2010
    Posts
    43

    Angry How to detect extra space?

    Hi Guys,

    Any suggestion on how to detect or search for an extra space?

    sample 1: " excel forum" - extra space in front

    sample 2: "excel forum" - extra space in the middle of two words

    sample 3: "excel forum " - extra space at the end

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: How to detect extra space?

    Try something like this...


    Please Login or Register  to view this content.
    Application.Trim removes extra spaces from the beginning, middle, and\or end of a text string.
    Last edited by AlphaFrog; 04-05-2017 at 10:13 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    08-03-2014
    Location
    Philippines
    MS-Off Ver
    Microsoft Office 2010
    Posts
    43

    Re: How to detect extra space?

    What if I want to run it to the whole worksheet and then identify the cell that have extra space?

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: How to detect extra space?

    ..........................deleted
    Last edited by Sintek; 04-06-2017 at 07:29 AM.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  5. #5
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: How to detect extra space?

    Here you go...This amended code of Alphafrog should work.
    Please Login or Register  to view this content.
    Last edited by Sintek; 04-06-2017 at 07:53 AM.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: How to detect extra space?

    Try
    Please Login or Register  to view this content.

+ 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] How to detect if any cell, in any tab, ends with a SPACE?
    By jmccoughlin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-06-2016, 02:46 PM
  2. [SOLVED] Extra space or spaces in Text in Forum Post. BB Code for extra space ?
    By Doc.AElstein in forum The Water Cooler
    Replies: 21
    Last Post: 03-02-2016, 02:59 PM
  3. VBA: Put extra space before units (keywords) if space is not there
    By sroysroy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-25-2015, 10:19 AM
  4. Excel 2007 : Remove Extra Space
    By Jerseynjphillypa in forum Excel General
    Replies: 2
    Last Post: 11-08-2011, 12:09 PM
  5. Replies: 2
    Last Post: 03-11-2008, 11:26 AM
  6. delete extra space
    By WBTKbeezy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-20-2006, 02:10 PM
  7. Extra line space
    By JJ in forum Excel General
    Replies: 1
    Last Post: 02-18-2005, 08:06 PM

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