+ Reply to Thread
Results 1 to 8 of 8

removing spaces

  1. #1
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    removing spaces

    Hi Forum

    Silly question, but my memory fails me... there is a VBA function that is essentially the equivalent of combining Trim and Rtrim. (removes both leading and trailing blanks) can someone remind me what that was?

    Thanks in advance!
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: removing spaces

    You can use excel's built-in function
    Please Login or Register  to view this content.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,897

    Re: removing spaces

    I think that you can use Trim and it will do it.

    http://www.techonthenet.com/excel/formulas/trim.php
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: removing spaces

    Haha, thanks guys.... just realized I answered the question while I asked it... i was looking to combine Ltrim and Rtrim, which indeed is Trim... no need for "application."

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: removing spaces

    Trim in VBA and Trim in excel are NOT the same, hence the need to access application(Excel).

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: removing spaces

    What is the difference? basic trim, no "application" seems to do the trick for me, but I'd love to know more.

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: removing spaces

    Yes, they are the same(There is only one) if you are using it in excel (using trim in excel as a function) ,but they are not the same in VBA. There is a trim method in VBA, but it is not the same as Excel's Trim function.
    You know you can access Excel's built function by using application or worksheetfunction method.

  8. #8
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: removing spaces

    Thanks AB33, I appreciate the explanation

+ 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. Excel 2007 : removing spaces
    By bjamin_w in forum Excel General
    Replies: 4
    Last Post: 02-19-2010, 09:04 AM
  2. Removing Spaces
    By jdomante in forum Excel General
    Replies: 4
    Last Post: 11-18-2009, 04:32 PM
  3. Removing spaces
    By janjan_376 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-05-2008, 01:22 PM
  4. Removing Spaces
    By Solarissf in forum Excel General
    Replies: 4
    Last Post: 08-31-2006, 11:23 AM
  5. Need:removing spaces
    By kcm in forum Excel General
    Replies: 4
    Last Post: 06-01-2005, 11:49 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