+ Reply to Thread
Results 1 to 3 of 3

Removing Trailing Spaces from Cells in Entire Spreadsheets

  1. #1
    Registered User
    Join Date
    12-02-2013
    Location
    Oulu, Finland
    MS-Off Ver
    Excel 2010
    Posts
    6

    Removing Trailing Spaces from Cells in Entire Spreadsheets

    Hi all,

    I have an Excel file with several worksheets and each of those worksheets has over 600 rows (a list of employees) and above or under 30 columns. Most of cells have trailing spaces in them and they vary in length. For example:
    B5: "Jacobson "
    C5: "[email protected] "
    (Seems like it's not allowing me to post long gaps between the last letters and the " but I hope you get the idea.)

    I'm aware of the TRIM function and know that I could at least get a column or a few copied with the spaces removed. However, it would just take so much time. What would be the most efficient way of getting rid of all the trailing spaces in all the cells in all the columns in all the worksheets?

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Removing Trailing Spaces from Cells in Entire Spreadsheets

    Select the cells you want to right trim, run the following macro:

    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    12-02-2013
    Location
    Oulu, Finland
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Removing Trailing Spaces from Cells in Entire Spreadsheets

    Works like a charm. Thanks, Olly!

    Issue solved.

+ 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. Delete Trailing Spaces without Removing leading zeros WITHOUT TRIM
    By Zach51215 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-20-2013, 04:24 PM
  2. [SOLVED] Removing leading and trailing spaces
    By mangesh in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-18-2013, 05:25 AM
  3. Removing trailing spaces without circular reference
    By DaveBF in forum Excel General
    Replies: 2
    Last Post: 05-18-2011, 10:33 AM
  4. Removing Trailing Spaces From Files On Hard Drive
    By Orangeworker in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-03-2011, 07:43 PM
  5. [SOLVED] Removing trailing spaces from cells ?
    By Ian in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-10-2005, 12:07 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