Consulting

Results 1 to 5 of 5

Thread: Accounting format alignment change

  1. #1
    VBAX Expert
    Joined
    Dec 2007
    Posts
    522
    Location

    Accounting format alignment change

    Hi All,

    In my workbook, I have a set of cells (like the picture shown), which are number-formatted as "Accounting", witha "$" prefix.

    As you can see the dollar is to the far left and the amounts are to the far right.

    Can we bring the "$" signs and the numerical value closer together, as I would like to center align all values in these cells (numbers and the "$" signs).

    Any ideas on how to go about this would be appreciated.

  2. #2
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    Narrowing the cell would bring them closer.

    Or, if you format the cell and select custom, you'll see something like
    _____($* #,##0.00_____) where the each underscore _ results in spacing from the edge of the cell. Increasing the underscores brings them closer (for some reason 4 underscores causes the parenthesis to show, but 3 or 5 doesn't)

  3. #3
    VBAX Expert
    Joined
    Dec 2007
    Posts
    522
    Location
    Quote Originally Posted by mikerickson
    Narrowing the cell would bring them closer.

    Or, if you format the cell and select custom, you'll see something like
    _____($* #,##0.00_____) where the each underscore _ results in spacing from the edge of the cell. Increasing the underscores brings them closer (for some reason 4 underscores causes the parenthesis to show, but 3 or 5 doesn't)
    Mike, I've played around a while and the solution for my purposes was simple enough:

    Changing the format to Currency, or just use a Cutom format such as :

    "$ #,##0"
    you can change the number of spaces between the $ and the number s (i.e. # in the above format) to suit your preference.

    Cheers and thanks for looking into this.

    I'm confused as to how the different experiments you mentioned above actually work out that way - Excel can be a little strange .

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    The difference, I think, is that Accounting will align symbols, Currency will not.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    VBAX Expert
    Joined
    Dec 2007
    Posts
    522
    Location
    Quote Originally Posted by mdmackillop
    The difference, I think, is that Accounting will align symbols, Currency will not.
    Ahh, I see now md, yes that is correct.

    For my purposes, the Currency format as specified worked as required.

    Sorry if I was vague in my initial requirements, and thanks sincerely for your efforts mike.

    Cheers,

Posting Permissions

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