ExcelBanter

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

khennet

personal numberformat
 
hi
i have some problem, wheni use a code from excel 97 to excel 2000

what i want is when a cells contains "0,00" i want it shows " -
i have a personal format like == Selection.NumberFormat = "#.00##;-#.00##;- ;
this format work well in excel97 but not in excel 2000
it doesn't display data!! (excel 2000), it hides all data

it works in this = Selection.NumberFormat = "#.00##;-#.00##;

can u give my a hand, please thank


JE McGimpsey

personal numberformat
 
It works for me in MacXLv.X, and it should work in XL00. Do you have the
Tools/Options/View/zero values checkbox checked?

In article ,
"khennet" wrote:

hi,
i have some problem, wheni use a code from excel 97 to excel 2000.

what i want is when a cells contains "0,00" i want it shows " - "
i have a personal format like == Selection.NumberFormat = "#.00##;-#.00##;-
;"
this format work well in excel97 but not in excel 2000.
it doesn't display data!! (excel 2000), it hides all data.

it works in this = Selection.NumberFormat = "#.00##;-#.00##;"

can u give my a hand, please thanks


Dave Peterson[_3_]

personal numberformat
 
This worked in xl2002:

#.00##;-#.00##;- ;@

When I did it manually.

So ....

Selection.NumberFormat = "#.00##;-#.00##;- ;@"

Should work ok in code?????



khennet wrote:

hi,
i have some problem, wheni use a code from excel 97 to excel 2000.

what i want is when a cells contains "0,00" i want it shows " - "
i have a personal format like == Selection.NumberFormat = "#.00##;-#.00##;- ;"
this format work well in excel97 but not in excel 2000.
it doesn't display data!! (excel 2000), it hides all data.

it works in this = Selection.NumberFormat = "#.00##;-#.00##;"

can u give my a hand, please thanks


--

Dave Peterson


Dave Peterson[_3_]

personal numberformat
 
It hid text values for me. (I think that's what data meant to the OP.)



JE McGimpsey wrote:

It works for me in MacXLv.X, and it should work in XL00. Do you have the
Tools/Options/View/zero values checkbox checked?

In article ,
"khennet" wrote:

hi,
i have some problem, wheni use a code from excel 97 to excel 2000.

what i want is when a cells contains "0,00" i want it shows " - "
i have a personal format like == Selection.NumberFormat = "#.00##;-#.00##;-
;"
this format work well in excel97 but not in excel 2000.
it doesn't display data!! (excel 2000), it hides all data.

it works in this = Selection.NumberFormat = "#.00##;-#.00##;"

can u give my a hand, please thanks


--

Dave Peterson


khennet

personal numberformat
 
didn't work manually neither in code

Dave Peterson[_3_]

personal numberformat
 
That's odd.

I just booted up xl2k and it worked both manually and as a macro for me.

What was the code you used?



khennet wrote:

didn't work manually neither in code


--

Dave Peterson


khennet

personal numberformat
 
i used
Selection.NumberFormat = "#.00##;-#.00##;- ;@
Selection.HorizontalAlignment = xlRigh
Selection.VerticalAlignment = xlCente
instead o

Selection.NumberFormat = "#.00##;-#.00##; -
Selection.HorizontalAlignment = xlRigh
Selection.VerticalAlignment = xlCente

and excel didn't show me " - " when data is 0.00 but "0.00"!!


khennet

personal numberformat
 
sorry,
your solution is right
it's only cells is in string format and NUMBERFORMAT didn't recognize "0.00" as 0 numeric
i change format in this wa
dim toto as variant
toto ="0,00
cells = tot
to cells = cdbl(toto

and now it works wel

THX everybody for help

Dave Peterson[_3_]

personal numberformat
 
Glad you found it. (Those text numbers are pesky!)

khennet wrote:

sorry,
your solution is right.
it's only cells is in string format and NUMBERFORMAT didn't recognize "0.00" as 0 numeric.
i change format in this way
dim toto as variant
toto ="0,00"
cells = toto
to cells = cdbl(toto)

and now it works well

THX everybody for help


--

Dave Peterson



All times are GMT +1. The time now is 03:31 PM.

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