+ Reply to Thread
Results 1 to 6 of 6

How to remove Space in a cell?

  1. #1
    Registered User
    Join Date
    03-12-2011
    Location
    Geographically Undesireable
    MS-Off Ver
    Excel 2007
    Posts
    3

    How to remove Space in a cell?

    Hi All, Newbie needing Help here.

    I have received a file from an SQL script that was saved into Excel format. I noticed there are spaces in all the colums at the beginning of each result. I tried to use the TRIM function but as usual the Noob in me has no idea what it is. If anyone could Guide me in step by step (in a simple English preferrably ) it would be much appreciated.

    PS: I was trying to add a screen shot to explain my problem but I guess this Forum wont allow it.

    PPS: Saved it as attachment..
    Attached Images Attached Images
    Last edited by WillowD; 03-13-2011 at 07:01 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: How to remove Space in a cell?

    Attach an example workbook instead of the screen shot
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    03-12-2011
    Location
    Geographically Undesireable
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to remove Space in a cell?

    As per request here is the sample of the actual workbook.
    Attached Files Attached Files

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: How to remove Space in a cell?

    This code will clear the leading spaces

    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste
    To run the Excel VBA code:

    Choose Tools | Macro | Macros
    Select a macro in the list, and click the Run button

  5. #5
    Registered User
    Join Date
    03-12-2011
    Location
    Geographically Undesireable
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to remove Space in a cell?

    Thank You!! It worked.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: How to remove Space in a cell?

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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