+ Reply to Thread
Results 1 to 3 of 3

Custom Text Alignment (Left-registered text on right side of cell)

  1. #1
    Registered User
    Join Date
    05-24-2013
    Location
    Florida, US
    MS-Off Ver
    Excel 2007
    Posts
    2

    Custom Text Alignment (Left-registered text on right side of cell)

    I've got a spreadsheet that contains a lot of nested categories with alphanumeric headers (I.E. (1) @ or a. @). What I've got looks like this at present:

    a. Adult
    b. Couple
    c. Family
    d. Child

    And I need it to be on the right side of the cell, but I want it so that abcd are vertically aligned. Like this:

    |_____________________________a. Adult__|
    |_____________________________b. Couple_|
    |_____________________________c. Family_|
    |_____________________________d. Child__|

    (Man...this forum does NOT like superfluous spaces, does it? Ignore the underscores.)

    It's the same concept as aligning the decimal point for numeric data, but for text. Is it at all possible to do this in Excel? This isn't (and won't be) a macro-enabled workbook and its primary function is to be as simple and automatic as possible so that a large group of people both familiar and unfamiliar with excel can update it regularly.

    The entire column of data is unmerged cells and of uniform size, if that helps. It used to be a much wider spreadsheet with multiple merged/unmerged rows to create the proper indents, etc, but I've been tasked with drastically simplifying it. For aesthetic purposes we want to keep everything in only 3 columns and use formatting to achieve a similar (but easier to update for non-excel-users) effect as before in the A column that contains all the text descriptions.



    UPDATE:
    I've just tried to use a custom format:

    _(0_);_(0);_("-"??_);_(" "@_)

    to try and force a set number of spaces in front, but for some reason this extends the height of the row...can't imagine why, but it ruins the even row heights (manually defining the row height is not an option, due to text wrapping requiring automatic adjustment).

    UPDATE:
    I've now just realized that excel has a built in indent function in the alignment tab of the cell format window. This solves the expanding row height issue, but it doesn't let me push the text all the way to edge before wrapping it.

    UPDATE:
    I was about to say "screw it" and live with a small gap on the right side of the cell, but I've just realized that conditional formatting doesn't have an alignment tab....why is life so hard?
    Last edited by Glamador; 05-24-2013 at 10:27 AM.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Custom Text Alignment (Left-registered text on right side of cell)

    Perhaps this is a method you can use...
    A1:A4 contains your list
    a._Adult
    b._Couple
    c._Family
    d._Child

    • Set Col_C width to 26
    • Set the C1:C4 font to Courier New...Size: 11

    • C1: =SUBSTITUTE(A1,"_",REPT(" ",CELL("width",C1)-LEN(A1)-5))
    Copy that formula down through C4

    The end result will look like this:
    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    05-24-2013
    Location
    Florida, US
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Custom Text Alignment (Left-registered text on right side of cell)

    Unfortunately not. The goal is to reduce the number of so-called "formatting columns" so that there is less for the less-than-savvy to screw up when they get their grubby mitts on the worksheet.

    If I start adding in columns just to use for spacing I'll just end up having to merge cells and manually wrap text and all the same nonsense I'm tasked with getting rid off.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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