ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Numberformat (https://www.excelbanter.com/excel-programming/291154-numberformat.html)

Syrus the Virus[_13_]

Numberformat
 
Hi,

Selection.NumberFormat = "[Green]#,##0_ ;[Blue]0,##0_;[Red]-#,##0 "

I tried to make a numberformat which gives:

green when positive
blue when zero
red when negative

Help me, please!

Tnxs in advanc

--
Message posted from http://www.ExcelForum.com


Bob Phillips[_6_]

Numberformat
 
Syrus,

Try this

"_-[Green]#,##0_-;_-[Blue]#,##0_-;_-[Red]-#,##0_-"

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Syrus the Virus " wrote in
message ...
Hi,

Selection.NumberFormat = "[Green]#,##0_ ;[Blue]0,##0_;[Red]-#,##0 "

I tried to make a numberformat which gives:

green when positive
blue when zero
red when negative

Help me, please!

Tnxs in advance


---
Message posted from http://www.ExcelForum.com/




Syrus the Virus[_14_]

Numberformat
 
What I usually do before posting a reply...... i test my
anwser.............................. I'd like to say thanks
but............. I can't it doesn't work!!


---
Message posted from http://www.ExcelForum.com/


Tom Ogilvy

Numberformat
 
Try this

"[Green]#,##0;[Blue]-#,##0;[Red]0"

I assume you want a negative sign in front of a negative number rather than
zero. Also, for zero #,##0 is kind of meaningless.

--
Regards,
Tom Ogilvy


"Syrus the Virus " wrote in
message ...
Hi,

Selection.NumberFormat = "[Green]#,##0_ ;[Blue]0,##0_;[Red]-#,##0 "

I tried to make a numberformat which gives:

green when positive
blue when zero
red when negative

Help me, please!

Tnxs in advance


---
Message posted from http://www.ExcelForum.com/




Alan Hutchins

Numberformat
 
I couldn't get the Number format to work if a number was
zero either.

But you could try the Conditional Formatting instead -
that works.

If you need to do teh format for a whole range, then
highlight the range before you select conditional
formatting.

HTH
-----Original Message-----
Hi,

Selection.NumberFormat = "[Green]#,##0_ ;[Blue]0,##0_;

[Red]-#,##0 "

I tried to make a numberformat which gives:

green when positive
blue when zero
red when negative

Help me, please!

Tnxs in advance


---
Message posted from http://www.ExcelForum.com/

.


Syrus the Virus[_15_]

Numberformat
 
Now there is an anwser I need. Damn I went out last night and can'
think straight ........ looking back on the problem........ i knew th
awnse

--
Message posted from http://www.ExcelForum.com


Bob Phillips[_6_]

Numberformat
 
Well you are one f**rI won't bother trying to help again after a comment
like that.

Bob

"Syrus the Virus " wrote in
message ...
What I usually do before posting a reply...... i test my
anwser.............................. I'd like to say thanks
but............. I can't it doesn't work!!


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 01:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com