+ Reply to Thread
Results 1 to 3 of 3

Macro to remove extra spaces in an Excel File

  1. #1
    Registered User
    Join Date
    08-13-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    88

    Macro to remove extra spaces in an Excel File

    Hi,

    I need a macro to remove extra spaces in an Excel file.
    Different cells may have additional spaces in the text and may also have additional spaces at the end of a sentence e.g

    Example
    Dublin Zoo is much more than a fun-filled, stimulating day out for all the family... it’s a place to learn about wild animals, especially those which are endangered. The Zoo is a registered charity – your visit will help maintain Dublin Zoo to a high standard, improve the Zoo and contribute to conservation programmes. The zoo etc

    The macro will have to work in all cells within the spreadsheet.

    Any help would be greatly appreciated.

  2. #2
    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,924

    Re: Macro to remove extra spaces in an Excel File

    Here is a solution for the leading spaces and trailing spaces.

    http://www.techonthenet.com/excel/formulas/trim.php

    Extra spaces in the body of a cell can probably be fixed using the Find and Replace Icon found on the ribbon
    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

  3. #3
    Registered User
    Join Date
    08-13-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: Macro to remove extra spaces in an Excel File

    Thank you very much!

+ 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. Remove extra spaces from columns
    By kre30a in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2013, 08:53 AM
  2. How to use vba to remove extra spaces between words
    By Joe Walsh in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 08-09-2013, 09:37 AM
  3. SOLVED - Looking to remove period and extra spaces from column B
    By Xaos in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-12-2013, 01:15 PM
  4. Replies: 8
    Last Post: 08-27-2012, 04:37 PM
  5. Remove extra spaces
    By kanezfan in forum Excel General
    Replies: 1
    Last Post: 07-05-2007, 02: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