+ Reply to Thread
Results 1 to 8 of 8

Adding leading spaces

Hybrid View

  1. #1
    David McRitchie
    Guest

    Re: Adding leading spaces

    If those are numbers then you can use cell formatting
    Format, Cells, custom

    Here are three you can check out: (from my formula.htm page)
    _($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)

    with asterisk protection:
    _($**#,##0.00_);[Red]_($**(#,##0.00);_($* "-"??_);_(@_)
    _(**$#,##0.00_);[Red]_(**$(#,##0.00);_(**$0.00_);_(@_)

    Additional examples at
    http://www.mvps.org/dmcritchie/excel...m#numberformat

    ---
    HTH,
    David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
    My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
    Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

    <gcotterl@co.riverside.ca.us> wrote in message news:1140801405.582420.55950@j33g2000cwa.googlegroups.com...
    > Some cells in Col A contain these amounts:
    >
    > $.58
    > $1,267,98
    > $1.20
    > $10,098.23
    > $.01
    > $258,957,98
    >
    > The horizontal alignment of these cells is left-justified.
    >
    > How do I add blanks (spaces) in front of the dollar-sign so the last
    > character of the amount aligns with the right margin? (Note, I can't
    > just right-justify the cells)
    >




  2. #2
    gcotterl@co.riverside.ca.us
    Guest

    Re: Adding leading spaces

    Col A of my spreadsheet contains:

    0ROBERT E WARREN JR INC

    329 S D ST

    PERRIS CA 92570 02/22/2006

    $171.22
    0 200500064 2005-2006 008-029
    000000870-9
    0SAUL, JERRY J & SHIRLEY M

    23670 SUNNYMEAD BLV

    MORENO VALLEY CA 92553 02/22/2006

    $.01
    0 200500066 2005-2006 021-329
    000000899-6
    0ELMER J WOOD INC

    2570 3RD ST

    RIVERSIDE CA 92507 02/22/2006

    $1,322.59
    0 200500076 2005-2006 009-005
    000000997-1

    How do I add leading-spaces ONLY to the cells whose first character is
    a dollar-sign (for example, "$171.22", "$.01" and "$1,322.59") so the
    right-most character ("2", "1" and "9") of the amount aligns with the
    right-margin?


  3. #3
    Jim Thomlinson
    Guest

    Re: Adding leading spaces

    I stand corrected... Cool...
    --
    HTH...

    Jim Thomlinson


    "David McRitchie" wrote:

    > If those are numbers then you can use cell formatting
    > Format, Cells, custom
    >
    > Here are three you can check out: (from my formula.htm page)
    > _($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)
    >
    > with asterisk protection:
    > _($**#,##0.00_);[Red]_($**(#,##0.00);_($* "-"??_);_(@_)
    > _(**$#,##0.00_);[Red]_(**$(#,##0.00);_(**$0.00_);_(@_)
    >
    > Additional examples at
    > http://www.mvps.org/dmcritchie/excel...m#numberformat
    >
    > ---
    > HTH,
    > David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
    > My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
    > Search Page: http://www.mvps.org/dmcritchie/excel/search.htm
    >
    > <gcotterl@co.riverside.ca.us> wrote in message news:1140801405.582420.55950@j33g2000cwa.googlegroups.com...
    > > Some cells in Col A contain these amounts:
    > >
    > > $.58
    > > $1,267,98
    > > $1.20
    > > $10,098.23
    > > $.01
    > > $258,957,98
    > >
    > > The horizontal alignment of these cells is left-justified.
    > >
    > > How do I add blanks (spaces) in front of the dollar-sign so the last
    > > character of the amount aligns with the right margin? (Note, I can't
    > > just right-justify the cells)
    > >

    >
    >
    >


  4. #4
    David McRitchie
    Guest

    Re: Adding leading spaces

    Hi Jim,
    Good, that takes off the pressure of guessing whether you had text or numbers for data.

    Had they been text cells you would have to do something to remove
    the $ sign, and the comma such as using Ctrl+H

    Then you would want to include your desired number formatting
    but no change in formatting would not occur until text data is converted to numbers.

    To TRIM the cells and reenter the values you could use the TrimALL macro
    http://www.mvps.org/dmcritchie/excel/join.htm#trimall
    ---
    HTH,
    David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
    My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
    Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

    "Jim Thomlinson" <JThomlinson@belron-Re-Move-This-canada.ca> wrote...
    > I stand corrected... Cool...




+ 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