View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
ShaneDevenshire ShaneDevenshire is offline
external usenet poster
 
Posts: 2,344
Default How to right-align text and numbers?

Hi,

Actually you can format the text to push it to the left from the right hand
margin.

The format code would be @" "

However, the actual spacing I leave up to you.

Here is another point to consider. When you right align a cell you can use
the Increase Indent command to indent from the right edge! And you can
control the amount of indent per click by going to Format, Cells, Alignment,
Indent.

If this helps, please click the Yes button.
--
Thanks,
Shane Devenshire


" wrote:

For readability, I have set up the following custom formats, using a
non-proprotional font (Courier New) and right horizontal alignment
with zero indentation:

#,##0" "
"[ "#,##0" ]","[ "-#,##0" ]"

(There are two spaces between quotes, or a combination of one space
and one square bracket.)

Thus, cells with normal numbers line up with numbers enclosed in
square brackets line. That is, the right-most units digit and the
comma separators line up.

Additionally, I want the column titles (dates or text) to line up with
the right-most units digit of the numbers. I tried the following
custom formats:

mmmyy" "
Text" "

The date format works well.

But the text format fails. The text is flush with the right-hand cell
wall instead of being two "Courier spaces" to the left.

I have worked around the problem by using normal Text format and right
horizontal alignment with one indentation instead of zero.

But I don't know if I can count on one indentation being equal to two
"Courier spaces".

(If I can, where is that documented?)

I would prefer to use a custom format that is similar to the others;
that is, something following by two spaces in quotes.

Can someone tell me how to do that?

And if there is a better way to do this altogether, I am open to
different approaches.