+ Reply to Thread
Results 1 to 8 of 8

Different Alignments in One Cell

  1. #1
    Forum Contributor
    Join Date
    09-29-2011
    Location
    ɹǝpun uʍop
    MS-Off Ver
    365
    Posts
    250

    Different Alignments in One Cell

    Hi,

    I have a need to put a name and a number in one cell.

    (e.g. John Smith 15)

    I would like the name to be left aligned and the number right aligned.

    Is this possible?

    Cheers, Paul.

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Different Alignments in One Cell

    never seen it before

    why do you want this? how many cells are we looking at?

    how bout the ol' insert spaces until it looks ok trick?
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Contributor
    Join Date
    09-29-2011
    Location
    ɹǝpun uʍop
    MS-Off Ver
    365
    Posts
    250

    Re: Different Alignments in One Cell

    Quote Originally Posted by humdingaling View Post
    never seen it before

    why do you want this? how many cells are we looking at?

    how bout the ol' insert spaces until it looks ok trick?
    It is a fixed cell (i.e. locked with formulas) and I can add spaces but it doesn't align properly, especially going from 9 to 10.

    Thee are about a dozen cells I need to do this with and I can't just add another column as it will mess up lots and lots of cells above and below. (Theorietically I guess I could, but it would take hours).

  4. #4
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Different Alignments in One Cell

    What is the formula or better a sample workbook.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  5. #5
    Forum Contributor
    Join Date
    09-29-2011
    Location
    ɹǝpun uʍop
    MS-Off Ver
    365
    Posts
    250

    Re: Different Alignments in One Cell

    Quote Originally Posted by vlady View Post
    What is the formula or better a sample workbook.
    Please Login or Register  to view this content.
    (Where Column A is a list of names and Column B is a list of numbers)

  6. #6
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Different Alignments in One Cell

    the problem with spaces and why it doesnt align is because most fonts dont have exact same spacing for every character

    Courier font however does have same spacing (monospaced font)

    see attached way of doing it

    also on the file i put a textbox way of doing it....it wouldnt be recommended if you have many....maybe if you have 10 or so it is ok but over that would be too much hassle to maintain i would think
    Attached Files Attached Files
    Last edited by humdingaling; 12-01-2014 at 08:52 PM.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Different Alignments in One Cell

    Row\Col
    A
    B
    C
    D
    1
    John Smith 15 John*Smith 15 B1: =SUBSTITUTE(A1, " ", CHAR(160), 1)


    The table above doesn't illustrate clearly, but does what you describe. The formula replaces the first space with a non-breaking space (which appears above as an asterisk, but not in Excel.)

    Then set the horizontal alignment for the cell with the formula to Distributed (Indent). Make the column as wide as you like, and it will align "John Smith" left and the "15" right.

    Finally, if you want, you can copy the formula cells, replace with values, and delete the original column.
    Last edited by shg; 12-01-2014 at 09:14 PM.
    Entia non sunt multiplicanda sine necessitate

  8. #8
    Forum Contributor
    Join Date
    09-29-2011
    Location
    ɹǝpun uʍop
    MS-Off Ver
    365
    Posts
    250

    Re: Different Alignments in One Cell

    Thanks for these suggestions. When time permits, I'll have a play with the different ways and see what suits best.

    Cheers, Paul.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to create/run "cell A equals Cell B put Cell C info in Cell D
    By abmb161 in forum Excel General
    Replies: 7
    Last Post: 02-05-2014, 02:20 AM
  2. Replies: 1
    Last Post: 11-06-2013, 02:56 AM
  3. Having different Alignments to multiple sentence in the same Cell
    By Tiyako in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 03-27-2013, 08:21 AM
  4. Replies: 1
    Last Post: 11-03-2012, 09:05 PM
  5. Multiple alignments
    By MD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-01-2005, 03:24 PM

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