+ Reply to Thread
Results 1 to 7 of 7

How to Copy Text to Fixed Length with leading Spaces ?

  1. #1
    tmb
    Guest

    How to Copy Text to Fixed Length with leading Spaces ?

    I need to copy the text data in one cell to another cell and end up with
    Fixed Length Ascii.

    Example:

    A1 = XYZ
    B1 = --XYZ

    Where -- are actually either Spaces

    thanks for any help



  2. #2
    Bob Phillips
    Guest

    Re: How to Copy Text to Fixed Length with leading Spaces ?

    =IF(LEN(A1)<5,REPT(" ",5-LEN(A1)),"")&A1

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "tmb" <[email protected]> wrote in message
    news:[email protected]...
    > I need to copy the text data in one cell to another cell and end up with
    > Fixed Length Ascii.
    >
    > Example:
    >
    > A1 = XYZ
    > B1 = --XYZ
    >
    > Where -- are actually either Spaces
    >
    > thanks for any help
    >
    >




  3. #3
    PeterAtherton
    Guest

    RE: How to Copy Text to Fixed Length with leading Spaces ?

    Hi

    Try =REPT("--",4-LEN(A1))&A1

    Regards
    Peter

    "tmb" wrote:

    > I need to copy the text data in one cell to another cell and end up with
    > Fixed Length Ascii.
    >
    > Example:
    >
    > A1 = XYZ
    > B1 = --XYZ
    >
    > Where -- are actually either Spaces
    >
    > thanks for any help
    >



  4. #4
    PeterAtherton
    Guest

    RE: How to Copy Text to Fixed Length with leading Spaces ?

    Sorry

    =REPT("-",5-LEN(A9))&A9

    Regards
    Peter



    "tmb" wrote:

    > I need to copy the text data in one cell to another cell and end up with
    > Fixed Length Ascii.
    >
    > Example:
    >
    > A1 = XYZ
    > B1 = --XYZ
    >
    > Where -- are actually either Spaces
    >
    > thanks for any help
    >
    >
    >


  5. #5
    Dave Peterson
    Guest

    Re: How to Copy Text to Fixed Length with leading Spaces ?

    One more:

    =RIGHT(REPT("-",5)&A1,5)

    Change the dash to a space character.



    tmb wrote:
    >
    > I need to copy the text data in one cell to another cell and end up with
    > Fixed Length Ascii.
    >
    > Example:
    >
    > A1 = XYZ
    > B1 = --XYZ
    >
    > Where -- are actually either Spaces
    >
    > thanks for any help


    --

    Dave Peterson

  6. #6
    Earl Kiosterud
    Guest

    Re: How to Copy Text to Fixed Length with leading Spaces ?

    It appears, from another post of yours, that you're going to use this to
    create a fixed-length file. If your data is text, you'll want padding on
    the right, most likely, but if numeric, you'll want left.

    There's a non-macro way to do all of this. Look at
    http://www.smokeylake.com/excel/textfiles.htm. And there are other posts on
    this subject in these newsgroups you should look at.

    --
    Earl Kiosterud
    mvpearl omitthisword at verizon period net
    -------------------------------------------

    "tmb" <[email protected]> wrote in message
    news:[email protected]...
    >I need to copy the text data in one cell to another cell and end up with
    >Fixed Length Ascii.
    >
    > Example:
    >
    > A1 = XYZ
    > B1 = --XYZ
    >
    > Where -- are actually either Spaces
    >
    > thanks for any help
    >
    >




  7. #7
    tmb
    Guest

    Re: How to Copy Text to Fixed Length with leading Spaces ?

    thanks Earl, your probably right. I'll double check the spec.

    "Earl Kiosterud" <[email protected]> wrote in message
    news:%[email protected]...
    > It appears, from another post of yours, that you're going to use this to
    > create a fixed-length file. If your data is text, you'll want padding on
    > the right, most likely, but if numeric, you'll want left.
    >
    > There's a non-macro way to do all of this. Look at
    > http://www.smokeylake.com/excel/textfiles.htm. And there are other posts
    > on this subject in these newsgroups you should look at.
    >
    > --
    > Earl Kiosterud
    > mvpearl omitthisword at verizon period net
    > -------------------------------------------
    >
    > "tmb" <[email protected]> wrote in message
    > news:[email protected]...
    >>I need to copy the text data in one cell to another cell and end up with
    >>Fixed Length Ascii.
    >>
    >> Example:
    >>
    >> A1 = XYZ
    >> B1 = --XYZ
    >>
    >> Where -- are actually either Spaces
    >>
    >> thanks for any help
    >>
    >>

    >
    >




+ 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