Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Fill trailing spaces (2003)

    I got this cryptic message when I came in the morning - "I need to fill the spaces in Excel after each sales area name so that when I save the Excel file to text the column width will remain the same. I am guessing that the width of the field is a certain length and she wants to save that field to text with a certain length. Is there any way to do that?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Fill trailing spaces (2003)

    To save as a fixed-width text file, select "Formatted text (space-delimited) (*.prn)" in the Save as type dropdown at the bottom of the Save As dialog. Excel will automatically insert the correct number of spaces needed (the column width in Excel determines the number of characters used for a column in the text file).

  3. #3
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Fill trailing spaces (2003)

    If you want to pad A1 to to 50 chars:

    =left(A1&rept(" ",50),50)

    It adds 50 spaces to the end of A1 then takes the first 50 characters...

    Steve

  4. #4
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Fill trailing spaces (2003)

    That saves the file as a prn. Can she open the prn and save it as text. I am not sure but I think she wants to bring the file into a mainframe program. I can open the file in Notepad but I wasn't sure if you can use the prn as a text file or am I way off.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Fill trailing spaces (2003)

    You can simply change the extension of the resulting .prn file to .txt in Windows Explorer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •