+ Reply to Thread
Results 1 to 11 of 11

Trim macro for excel 2003

  1. #1
    Forum Contributor
    Join Date
    12-14-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    102

    Trim macro for excel 2003

    Hi,
    I need a macro for excel 2003 that allows me to trim whitespace before/after the cell content and asign the cell range. I've tried a few off google search but with no luck. Is there anyone who has a code that will work in both Excel 2003 and Excel 2010? I searched the forums too and haven't had any luck finding anything.

  2. #2
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Trim macro for excel 2003

    the first part I get, but what do you mean by "...and asign the cell range..."?
    If you like my contribution click the star icon!

  3. #3
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Trim macro for excel 2003

    attach a sample file with current table and derised result
    If solved remember to mark Thread as solved

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Trim macro for excel 2003

    Not quite sure what you mean. Can you give a specific example.

    Do you really need a macro. The obvious function is =TRIM(A1") does that work for you?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Forum Contributor
    Join Date
    12-14-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    102

    Re: Trim macro for excel 2003

    Hi OllieB,
    I need a macro that will trim A1:P500. I'd like to asign the range that the macro trims so it isn't trimming the entire sheet.

  6. #6
    Forum Contributor
    Join Date
    12-14-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    102

    Re: Trim macro for excel 2003

    I need a macro for this to run with a few othere macros.

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Trim macro for excel 2003


  8. #8
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Trim macro for excel 2003

    Heres a couple ways. Second option would be faster

    Please Login or Register  to view this content.
    Last edited by mike7952; 01-10-2013 at 10:38 AM.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  9. #9
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Trim macro for excel 2003

    So many experts helping out, what a great forum!

  10. #10
    Forum Contributor
    Join Date
    12-14-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    102

    Re: Trim macro for excel 2003

    Quote Originally Posted by JOHN H. DAVIS View Post
    John,
    I gave it a try, and wiped out the database file by adding 0 to most of the cells that had content in it. So I closed it without saving.

  11. #11
    Forum Contributor
    Join Date
    12-14-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    102

    Re: Trim macro for excel 2003

    Quote Originally Posted by mike7952 View Post
    Heres a couple ways. Second option would be faster
    I'll take the prize behind door #2. That did the trick. Thanks for all the replies.
    Last edited by smugglersblues; 01-10-2013 at 11:01 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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