personal numberformat

K

khennet

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
 
J

JE McGimpsey

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

Dave Peterson

This worked in xl2002:

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

When I did it manually.

So ....

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

Should work ok in code?????
 
D

Dave Peterson

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?
 
K

khennet

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"!!
 
K

khennet

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
 
Top