Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXCEL CUSTOM NUMBER FORMAT QUESTION 1

Status
Not open for further replies.
Joined
Aug 29, 2001
Messages
151
Location
US
In Execl, I am trying to create a custom number format (Format Cells Number Custom) that adds several blank spaces to the right of the number. I am able to use quotes to add a character to the right of the number, but if I put blanks inside the quotes, then the number appears all the way to the right of the cell.

The contents of the cell must be a number (not text). I cannot use allignment. I must be able to move the number in the cell over to the left three spaces. Any ideas?

Thanks
 
r u using double quotes? I just tried it and works fine for me. XL2K Win2K
 
You cannot have the contents of a cell contains spaces and still be formatted as a number.

Why do you need the number moved to the left? Perhaps we can provide a workaround. Anne Troy
 
Hiya,

I just added this custom number format:
#,##0.00
type three spaces after it
clicked OK
works fine

I then checked out the NumberFormat in the dialogbox & there are no quotes around the spaces - resulting format reads '#,##0.00 '
plz imagine the three spaces & unimagine the two single wquotes. Its darn hard to actually *show* spaces ;-)

I then added some code using the NumberFormat property of the cell & setting that to '#,##0.00 '
Code:
Range("A1:T10").NumberFormat = "#,##0.00   "
Again, works fine

Am working with Excel 97, btw

puzzled as to why it wouldn;t work, unless, as Anne suggests, you've actually got TEXt in there rather than numbers (by which I mean something looking like numbers but xl parsing as text)

HTH

Cheers
Nikki
 
Oh you guys . . .
You are brilliant and of course right! Problem was the WRAP TEXT box was checked. Don't know why this should affect the resutls, but it does. When I follow you instructions (which is one of the million custom formats I tried before) the number would not move AT ALL with blanks at the end - only with text. Anyhow, now I can sleep tonight.
Thank you. Thank you. Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top