+ Reply to Thread
Results 1 to 5 of 5

RegEx to eliminat white spaces form a string

  1. #1
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    RegEx to eliminat white spaces form a string

    Hello,
    Could anyone please advise, how to eliminate spaces from a string using a VBA code?

    Example:
    a 022 .a22 Convert into: a022.a22.

    Note, the string can be of variable length.
    Thanks

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: RegEx to eliminat white spaces form a string

    Hi plans, any specific reason why you want to use RegEx for this?

  3. #3
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Re: RegEx to eliminat white spaces form a string

    No, any other solution would be great.
    Thanks.

  4. #4
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: RegEx to eliminat white spaces form a string

    First an example how to do it with Regex,
    Please Login or Register  to view this content.
    otherwise, try,
    Please Login or Register  to view this content.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: RegEx to eliminat white spaces form a string

    Or just a formula:

    =SUBSTITUTE(SUBSTITUTE(A1, CHAR(160), ""), " ", "")
    Entia non sunt multiplicanda sine necessitate

+ 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] remove white spaces in a specific column
    By stoey in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-12-2014, 11:57 PM
  2. [SOLVED] How to remove white spaces from a phrase?
    By sami770 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-30-2014, 02:02 PM
  3. Replace white spaces with tab delimiter to creare table
    By thadacto in forum Word Programming / VBA / Macros
    Replies: 4
    Last Post: 12-01-2013, 03:56 PM
  4. Remove White Spaces from all cells
    By modest_16081982 in forum Excel General
    Replies: 18
    Last Post: 05-03-2013, 07:22 AM
  5. Replies: 2
    Last Post: 07-20-2012, 01:59 PM
  6. Copy cell value and delete white spaces?
    By gombi in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-04-2010, 08:24 AM
  7. Remove white spaces in Back
    By dziw in forum Excel General
    Replies: 2
    Last Post: 07-19-2006, 01:55 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